Skip to content

How to use ttl_lock configuration #83

@alfredo-rico

Description

@alfredo-rico

Hi 👋 sorry for making this question in the issues but I didn't find any proper documentation somewhere so I decided to ask here.

It's no clear to me how to use ttl_lock. is it the time that the thread would be locked? lets suppose this scenario:
I have a sidekiq job that runs every 10 minutes with sidekiq-scheduler and also I defined it as unique with:

unique :while_executing, ttl_lock: 8.minutes, on_conflict: :log

Usually the job takes two minutes to finish, And lets imagine that at some moment the current job takes more than 10 minutes. Sidekiq start a new job and what will happen? will it start to execute the next job because the lock has been released without waiting for the previous one? how to avoid this situation? should I defined a largest ttl_lock ?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions