steinitzu / celery-singleton

Seamlessly prevent duplicate executions of celery tasks
MIT License
237 stars 36 forks source link

Don't unlock the task if lock_expiry is still valid #51

Open aguedob opened 1 year ago

aguedob commented 1 year ago

Hi!

In my use case I need the task result to be cached until the lock time expires, in order to avoid new tasks with the same input data. Does it make sense to you keeping the lock even if the task has finished?

steinitzu commented 1 year ago

I would rather add a new parameter for this so it's not such a dramatic change in behaviour. E.g. unlock_when_finished (default True)

steinitzu commented 1 year ago

Possibly even separate params: unlock_on_success / unlock_on_failure