Expire old oauth nonces
authorTom Hughes <tom@compton.nu>
Mon, 7 Nov 2016 11:31:58 +0000 (11:31 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 7 Nov 2016 11:31:58 +0000 (11:31 +0000)
script/cleanup

index d7f29239c70a57c0007adff01a64a4e1a242b0f2..3eaeef7c6a739efa50ddb71f930cbb22c1869094 100755 (executable)
@@ -3,5 +3,6 @@
 require File.dirname(__FILE__) + "/../config/environment"
 
 UserToken.delete_all("expiry < NOW()")
+OauthNonce.delete_all("timestamp < EXTRACT(EPOCH FROM NOW() - INTERVAL '1 day')")
 
 exit 0