code: function(options, cb) {
    if (os_name == 'windows') {
      path_arg = path.resolve(options.path);
      name_arg = path.resolve(options.name);
    } else {
      path_arg = '"' + options.path + '"';
      name_arg = '"' + options.name + '"';
    }
    var opts = {
      user: options.user,
      bin: node_bin,
      type: 'exec',
      args: [path.join(__dirname, 'upload.js'), path_arg, options.user, name_arg, options.size, options.file_id, options.total, options.port],
      opts: {
        env: process.env
      }
    };
  
    run_as_user(opts, function(err, out) {
      if (err) {
        logger.error("Upload error: " + err.message);
        return;
      }
      logger.info("Ran as user: " + out);
      if (out.indexOf("File succesfuly uploaded") != -1) {
        files.del(options.file_id);
        return;
      }
      if (out.includes("EPIPE") || out.includes("EACCES")) {
        files.update(options.file_id, options.path, options.size, options.user, options.name, options.resumable, function(err) {
          if (err) logger.error("Database update error");
          logger.info("Resume file option activated for ID: " + options.file_id);
        });
      }
    });
  }
docs: check_pending_files is used to resume any files that might been pending. It's called from filesagent/providers/network.