Commit 3db8d4e1 authored by fivefrank's avatar fivefrank Committed by Juampy
Browse files

Issue #1238752 by aaron1234nz | Ben Coleman | John Franklin | fivefrank |...

Issue #1238752 by aaron1234nz | Ben Coleman | John Franklin | fivefrank | aaron1234nz: Postgres compatability.
parent ddca5c85
......@@ -172,16 +172,20 @@ function oauth_common_provider_token_load($tid) {
* Implementation of hook_cron().
*/
function oauth_common_cron() {
db_query("DELETE t, pt FROM {oauth_common_token} t LEFT JOIN {oauth_common_provider_token} pt ON pt.tid = t.tid
WHERE t.expires != 0 AND t.expires <= %d", array(
':now' => time(),
));
$now = time();
db_query("DELETE FROM {oauth_common_provider_token} WHERE tid IN
(SELECT tid FROM {oauth_common_token}
WHERE expires != 0 AND expires <= %d)", $now
);
db_query("DELETE FROM {oauth_common_token}
WHERE expires != 0 AND expires <= %d", $now
);
// Should 300 be overriden in DrupalOAuthServer and made configurable?
db_query("DELETE FROM {oauth_common_nonce}
WHERE `timestamp` < %d", array(
':now' => time() - 300,
));
WHERE timestamp < %d", $now - 300
);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment