Freewind
Freewind

Reputation: 198318

How to set expire time when add a task to resque?

I'm using Rails with Resque.

I know the command of redis-cli is:

expire key 100

But I don't know how to set the expire time when adding a task to resque, what should I do?

Upvotes: 1

Views: 1619

Answers (1)

Freewind
Freewind

Reputation: 198318

Get the redis connection:

Resque.redis.expire "key", 100

The redis is defined in redis-rb gem

Upvotes: 1

Related Questions