Friday 21 April 2017

elastic beanstalk node script is re-starting instead of running just once

I have a node script on elastic beanstalk, here is a very simple example:

app.js:

var process_name = require('./src/process_script');
process_name.handler();

src/process_script.js:

'use strict';
exports.handler = function() {
    new Promise(function(resolve, reject) {
        console.log("hola!");
})
}

When I run it on my local, it runs once, just like I want it to.

But on Elastic Beanstalk, as soon as it is complete, it hits "app.js" again, runs, then hits "app.js" again, ad infinitum.

I really only want it to run once. Does anyone know how I can prevent Elastic Beanstalk from repeating the script?

(in case you are wondering why I'm not using lambda, the script takes longer than 5 minutes to run and eventually I'd like to set it up with a cron task)



via elas_bean

No comments:

Post a Comment