Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93037576
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
Mon, Nov 25, 17:54
Size
698 B
Mime Type
text/x-php
Expires
Wed, Nov 27, 17:54 (2 d)
Engine
blob
Format
Raw Data
Handle
22559184
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