ajvb / kala

Modern Job Scheduler
MIT License
2.12k stars 187 forks source link

[Mongo] Multiple Job documents from a single job #189

Open cescoferraro opened 6 years ago

cescoferraro commented 6 years ago

I have used Kala before with Redis. Perfect! Thanks Guys! But on this specific project I would like to use the new Mongo Driver since this project already have a MongoDB within its infrastructure.

The following commands happen to create multiple documents to the same job The tasks seem to run nicely, but I am afraid this multiple documents will bloat up my database

$ kala run --jobDB=mongo --jobDBAddress=xxxxx.domain.live --jobDBUsername=admin --jobDBPassword=pass

$ http http://127.0.0.1:8000/api/v1/job/ name=test_job command="touch lol" schedule=R0/2018-08-09T09:57:30-07:00/P

Fresh Database with a single command creates 8 documents

mongokala

sekar-fa commented 5 years ago

@cescoferraro It's issue with the storage/mongo in the Save() instead of using Upsert it is using Insert(). Please let me know if you are still using kala.