Closed micahstubbs closed 5 years ago
this answer recommending limiting concurrency with queues from the async
package https://github.com/caolan/async
looks promising https://stackoverflow.com/a/9547175/1732222
var async = require("async");
function upload_file(file, callback) {
// Do funky stuff with file
callback();
}
var queue = async.queue(upload_file, 10); // Run ten simultaneous uploads
queue.drain = function() {
console.log("All files are uploaded");
};
// Queue your files for upload
queue.push(files);
queue.concurrency = 20; // Increase to twenty simultaneous uploads
and then the related error with express https://stackoverflow.com/questions/19917401/error-request-entity-too-large
this is useful to see the logs of the service
journalctl -u screenshot-bot.service -f
this doesn't look right - 10 different requests, but writing to the bucket 10 times with the same filename of the first request url 🤔