intridea/oauth2 — pull request #117 by homakov (2012-08-30 18:26:04+00:00)
Title: expired_in? method 

Developers usually check .expired? method but it works in a very straightforward manner and doesn't check e.g. will the token be expired in the next couple of seconds. It causes like 0.1-1% failed requests for normal and delayed jobs, not synced unix time because there is always some legacy between expired? check and its usage.

```
if token.expired_in? 3.minutes
refresh_token
end
delayed_queue.push job
```