Monday 15 April 2013

python - Common celery workers for different clients having different DBs -



python - Common celery workers for different clients having different DBs -

i'm using celery django , storing task results in db. i'm considering having single set of workers reading messages single message broker. can have multiple clients submitting celery tasks , each client have tasks , results created/stored in different db. though workers common, know db operate upon each task.

can have duplicate task ids generated because submitted different clients pointing different dbs?

thanks,

eventually have duplicates. many people ignore issue because "low probability", , surprised when hits them. , story leaks how logged uses facebook account. if require them unique have prefix each id never repeat - current date , time microseconds.

and if not enough, because there still tinier chance of collision, can create little application generate prefixes, , add together counter (incremented after each hash request, , reset every couple seconds) date , microseconds. have work in single-threaded mode, guarantee generate unique prefixes won't collide.

python django celery django-celery

No comments:

Post a Comment