Page MenuHomeIsabelle/Phabricator
Diviner Phabricator Tech Docs PhabricatorTriggerDaemon

final class PhabricatorTriggerDaemon
Phabricator Technical Documentation (Daemons)

Schedule and execute event triggers, which run code at specific times.

Also performs garbage collection of old logs, caches, etc.

Tasks

Garbage Collection

  • private function runGarbageCollection($duration) — Run the garbage collector for up to a specified number of seconds.
  • private function updateGarbageCollection() — Update garbage collection, possibly collecting a small amount of garbage.

Other Methods

Methods

protected function willRun()
Inherited

This method is not documented.
Return
wild

protected function willSleep($duration)
Inherited

This method is not documented.
Parameters
$duration
Return
wild

public function getViewer()
Inherited

This method is not documented.
Return
wild

public static function sudoCommandAsDaemonUser($command)
Inherited

PhabricatorDaemon

Format a command so it executes as the daemon user, if a daemon user is defined. This wraps the provided command in sudo -u ..., roughly.

Parameters
PhutilCommandString$commandCommand to execute.
Return
PhutilCommandString`sudo` version of the command.

protected function run()

This method is not documented.
Return
wild

private function scheduleTriggers($cursor)

Process all of the triggers which have been updated since the last time the daemon ran, scheduling them into the event table.

Parameters
int$cursorCursor for the next version update to process.
Return
void

private function executeTriggers()

Run scheduled event triggers which are due for execution.

Return
void

private function getSleepDuration()

Get the number of seconds to sleep for before starting the next scheduling phase.

If no events are scheduled soon, we'll sleep briefly. Otherwise, we'll sleep until the next scheduled event.

Return
intNumber of seconds to sleep for.

private function loadCurrentCursor()

This method is not documented.
Return
wild

private function loadCurrentVersion()

This method is not documented.
Return
wild

private function updateCursor($value)

This method is not documented.
Parameters
$value
Return
wild

private function loadCurrentCounter($counter_name)

This method is not documented.
Parameters
$counter_name
Return
wild

private function runGarbageCollection($duration)

Run the garbage collector for up to a specified number of seconds.

Parameters
int$durationNumber of seconds the GC may run for.
Return
intNumber of seconds remaining in the time budget.

private function updateGarbageCollection()

Update garbage collection, possibly collecting a small amount of garbage.

Return
boolTrue if there is more garbage to collect.

private function runNuanceImportCursors($duration)

This method is not documented.
Parameters
$duration
Return
wild

private function updateNuanceImportCursors()

This method is not documented.
Return
wild

private function runCalendarNotifier($duration)

This method is not documented.
Parameters
$duration
Return
wild