Avoid sleeping after first execution #152

Closed
aulisse opened this Issue May 8, 2014 · 3 comments

Projects

None yet

2 participants

@aulisse
aulisse commented May 8, 2014

Hello, a quick question: is it possible to make dynamic-dynamodb stop after the first execution? In other words, is there any configuration, or anything that I can do, to make the python process stop after the first loop on the tables matching the table section?

I am not running the script through a daemon.

Thanks!

@sebdah sebdah self-assigned this May 8, 2014
@sebdah sebdah added this to the 1.13.x milestone May 8, 2014
@sebdah
Owner
sebdah commented May 8, 2014

It is currently not supported. But I am about to release a new version of dynamic-dynamodb. I will include a command line option (--run-once) that will trigger that behaviour.

@sebdah sebdah added a commit that referenced this issue May 8, 2014
@sebdah Added --run-once functionality #152 fcaf862
@sebdah sebdah closed this May 8, 2014
@sebdah
Owner
sebdah commented May 8, 2014

1.13.0 is out now, including this change!

@aulisse
aulisse commented May 8, 2014

Thanks! Perfectly working!

I need the "--run-once" option because I run the script in a Java application running in an autoscaling group that has ~8 EC2 instances, and I don't want that it runs on each server, but exactly on one, by specifying a cron expression.

I exploit the optimistic locking of Dynamo DB, combined with ntp synchronization and a cron expression, in order to run the script exactly on one random active node from inside a java job. Thus, I don't have any single point of failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment