Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93534385
PhabricatorTaskmasterDaemonModule.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
Fri, Nov 29, 12:58
Size
698 B
Mime Type
text/x-php
Expires
Sun, Dec 1, 12:58 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22658858
Attached To
rPH Phabricator
PhabricatorTaskmasterDaemonModule.php
View Options
<?php
final
class
PhabricatorTaskmasterDaemonModule
extends
PhutilDaemonOverseerModule
{
public
function
shouldWakePool
(
PhutilDaemonPool
$pool
)
{
$class
=
$pool
->
getPoolDaemonClass
();
if
(
$class
!=
'PhabricatorTaskmasterDaemon'
)
{
return
false
;
}
if
(
$this
->
shouldThrottle
(
$class
,
1
))
{
return
false
;
}
$table
=
new
PhabricatorWorkerActiveTask
();
$conn
=
$table
->
establishConnection
(
'r'
);
$row
=
queryfx_one
(
$conn
,
'SELECT id FROM %T WHERE leaseOwner IS NULL
OR leaseExpires <= %d LIMIT 1'
,
$table
->
getTableName
(),
PhabricatorTime
::
getNow
());
if
(!
$row
)
{
return
false
;
}
return
true
;
}
}
Event Timeline
Log In to Comment