mirror of
https://github.com/friendica/friendica
synced 2025-04-26 16:30:12 +00:00
Move Temporal::convert() to DateTimeFormat::convert()
This commit is contained in:
parent
b7a7355292
commit
5e7285b9ba
64 changed files with 568 additions and 551 deletions
|
@ -9,10 +9,9 @@ use Friendica\Core\Config;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Process;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Lock;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
use dba;
|
||||
|
||||
require_once 'include/dba.php';
|
||||
|
@ -235,7 +234,7 @@ class Worker
|
|||
|
||||
if ($age > 1) {
|
||||
$stamp = (float)microtime(true);
|
||||
dba::update('workerqueue', ['executed' => Temporal::utcNow()], ['pid' => $mypid, 'done' => false]);
|
||||
dba::update('workerqueue', ['executed' => DateTimeFormat::utcNow()], ['pid' => $mypid, 'done' => false]);
|
||||
self::$db_duration += (microtime(true) - $stamp);
|
||||
}
|
||||
|
||||
|
@ -245,7 +244,7 @@ class Worker
|
|||
|
||||
$stamp = (float)microtime(true);
|
||||
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
|
||||
Config::set('system', 'last_poller_execution', Temporal::utcNow());
|
||||
Config::set('system', 'last_poller_execution', DateTimeFormat::utcNow());
|
||||
}
|
||||
self::$db_duration = (microtime(true) - $stamp);
|
||||
|
||||
|
@ -278,7 +277,7 @@ class Worker
|
|||
|
||||
if ($age > 1) {
|
||||
$stamp = (float)microtime(true);
|
||||
dba::update('workerqueue', ['executed' => Temporal::utcNow()], ['pid' => $mypid, 'done' => false]);
|
||||
dba::update('workerqueue', ['executed' => DateTimeFormat::utcNow()], ['pid' => $mypid, 'done' => false]);
|
||||
self::$db_duration += (microtime(true) - $stamp);
|
||||
}
|
||||
|
||||
|
@ -286,7 +285,7 @@ class Worker
|
|||
|
||||
$stamp = (float)microtime(true);
|
||||
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
|
||||
Config::set('system', 'last_poller_execution', Temporal::utcNow());
|
||||
Config::set('system', 'last_poller_execution', DateTimeFormat::utcNow());
|
||||
}
|
||||
self::$db_duration = (microtime(true) - $stamp);
|
||||
} else {
|
||||
|
@ -574,7 +573,7 @@ class Worker
|
|||
}
|
||||
dba::update(
|
||||
'workerqueue',
|
||||
['executed' => NULL_DATE, 'created' => Temporal::utcNow(), 'priority' => $new_priority, 'pid' => 0],
|
||||
['executed' => NULL_DATE, 'created' => DateTimeFormat::utcNow(), 'priority' => $new_priority, 'pid' => 0],
|
||||
['id' => $entry["id"]]
|
||||
);
|
||||
} else {
|
||||
|
@ -825,7 +824,7 @@ class Worker
|
|||
if ($found) {
|
||||
$condition = "`id` IN (".substr(str_repeat("?, ", count($ids)), 0, -2).") AND `pid` = 0 AND NOT `done`";
|
||||
array_unshift($ids, $condition);
|
||||
dba::update('workerqueue', ['executed' => Temporal::utcNow(), 'pid' => $mypid], $ids);
|
||||
dba::update('workerqueue', ['executed' => DateTimeFormat::utcNow(), 'pid' => $mypid], $ids);
|
||||
}
|
||||
|
||||
return $found;
|
||||
|
@ -953,7 +952,7 @@ class Worker
|
|||
|
||||
/// @todo We should clean up the corresponding workerqueue entries as well
|
||||
$condition = ["`created` < ? AND `command` = 'worker.php'",
|
||||
Temporal::utc("now - ".$timeout." minutes")];
|
||||
DateTimeFormat::utc("now - ".$timeout." minutes")];
|
||||
dba::delete('process', $condition);
|
||||
}
|
||||
|
||||
|
@ -1040,7 +1039,7 @@ class Worker
|
|||
|
||||
$priority = PRIORITY_MEDIUM;
|
||||
$dont_fork = Config::get("system", "worker_dont_fork");
|
||||
$created = Temporal::utcNow();
|
||||
$created = DateTimeFormat::utcNow();
|
||||
|
||||
if (is_int($run_parameter)) {
|
||||
$priority = $run_parameter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue