Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #73 from joshsoftware/issue-45
Browse files Browse the repository at this point in the history
Added info/notes about expiration time, fixes #45
  • Loading branch information
utgarda committed Dec 15, 2015
2 parents 0849e56 + dee5c80 commit cd54c56
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ end

But keep in mind that such thing will store details of job as long as expiration is set, so it may charm your Redis storage/memory consumption. Because Redis stores all data in RAM.

### What is expiration time ?
As you noticed you can set expiration time for jobs globally by expiration option while adding middleware or writing a expiration method on each worker this expiration time is nothing but

+ [Redis expire time](http://redis.io/commands/expire), also know as TTL(time to live)
+ After expiration time all the info like status, update_time etc. about the worker disappears.
+ It is advised to set this expiration time greater than time required for completion of the job.
+ Default expiration time is 30 minutes.

### Retrieving status

Query for job status any time later:
Expand All @@ -82,6 +90,7 @@ Sidekiq::Status::failed? job_id
Sidekiq::Status::interrupted? job_id

```
Important: If you try any of the above status method after the expiration time, will result into `nil` or `false`

### Tracking progress, saving, and retrieving data associated with job

Expand Down Expand Up @@ -129,6 +138,7 @@ Sidekiq::Status.unschedule nil #=> false
Sidekiq::Status.unschedule '' #=> false
# Note: cancel and unschedule are alias methods.
```
Important: If you try any of the status method after the expiration time for scheduled jobs, will result into `nil` or `false`. But job will be in sidekiq's scheduled queue and will execute normally, once job is started on scheduled time you will get status info for job till expiration time defined on `Sidekiq::Status::ServerMiddleware`.

### Sidekiq web integration

Expand Down

0 comments on commit cd54c56

Please sign in to comment.