Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101442799
ConduitTokenGarbageCollector.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 10, 12:56
Size
642 B
Mime Type
text/x-php
Expires
Wed, Feb 12, 12:56 (2 d)
Engine
blob
Format
Raw Data
Handle
24148238
Attached To
rPH Phabricator
ConduitTokenGarbageCollector.php
View Options
<?php
final
class
ConduitTokenGarbageCollector
extends
PhabricatorGarbageCollector
{
const
COLLECTORCONST
=
'conduit.tokens'
;
public
function
getCollectorName
()
{
return
pht
(
'Conduit Tokens'
);
}
public
function
hasAutomaticPolicy
()
{
return
true
;
}
protected
function
collectGarbage
()
{
$table
=
new
PhabricatorConduitToken
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn_w
,
'DELETE FROM %T WHERE expires <= %d
ORDER BY dateCreated ASC LIMIT 100'
,
$table
->
getTableName
(),
PhabricatorTime
::
getNow
());
return
(
$conn_w
->
getAffectedRows
()
==
100
);
}
}
Event Timeline
Log In to Comment