Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F119740929
PhabricatorMetronomicTriggerClock.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
Sun, Jun 29, 01:56
Size
729 B
Mime Type
text/x-php
Expires
Tue, Jul 1, 01:56 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27040970
Attached To
rPH Phabricator
PhabricatorMetronomicTriggerClock.php
View Options
<?php
/**
* Triggers an event repeatedly, delaying a fixed number of seconds between
* triggers.
*
* For example, this clock can trigger an event every 30 seconds.
*/
final
class
PhabricatorMetronomicTriggerClock
extends
PhabricatorTriggerClock
{
public
function
validateProperties
(
array
$properties
)
{
PhutilTypeSpec
::
checkMap
(
$properties
,
array
(
'period'
=>
'int'
,
));
}
public
function
getNextEventEpoch
(
$last_epoch
,
$is_reschedule
)
{
$period
=
$this
->
getProperty
(
'period'
);
if
(
$last_epoch
)
{
$next
=
$last_epoch
+
$period
;
$next
=
max
(
$next
,
$last_epoch
+
1
);
}
else
{
$next
=
PhabricatorTime
::
getNow
()
+
$period
;
}
return
$next
;
}
}
Event Timeline
Log In to Comment