Strapi restarts server after pdf file upload | Want to bypass that so script is not interrupted

System Information
  • Strapi Version: 3.0.0-beta.18.3
  • Operating System: Linux
  • Database: sqlite3
  • Node Version: 3.0.0-beta.18.3
  • NPM Version: 8.6.0
  • Yarn Version: 1.22.19

I am building a strapi app that creates a pdf and in which I want to send an email to the user after that, with the pdf attached.

The issue is that the moment the pdf is saved in the upload/files directory the server reloads. Being so, the script is interrupted and the email is never sent.

What I want is that the server doesn’t restart at the upload, the script continues and so the email is sent.

I am using strapi v3 and the upload plugin.

I already tried to use the watchIgnoreFiles pointing to the upload/files directory in the admin.js, but the strapi server still restarts. (Change file without triggering a reload of Strapi - #8 by speedy). But I am in doubt if this is the right way, since I am not changing a file, but creating a new one, which is content and not a system file. My admin.js file is as follows:

module.exports = ({ env }) => ({
admin: {
autoOpen: false,
watchIgnoreFiles: [

Thank you for your help.