Skip to content

Implement TTR #2

@igorsantos07

Description

@igorsantos07

Currently there's no implementation of time-to-run hooks. Jobs may timeout and we will never know?

Possible implementation: when a job is reserved, turn the delay into ttr: if there's no TTR, delay becomes zero; if there's TTR, delay becomes time()+TTR. Finally, peeks/reserves will return jobs with state=reserved AND delay<time(), but won't return any reserved job with delay=0 - meaning a job that gets reserved with no timeout will be reserved only once, but if it's reserved with a timeout and it expires, it can be reserved again, and if it's ready, it can be reserved as soon as its delay expired.

  • implement TTR behaviour
  • implement Job::touch()
  • include this on tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions