Page MenuHomePhabricator

D20200.id48231.diff
No OneTemporary

D20200.id48231.diff

diff --git a/resources/sql/autopatches/20190220.daemon_worker.completed.01.sql b/resources/sql/autopatches/20190220.daemon_worker.completed.01.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190220.daemon_worker.completed.01.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_worker.worker_archivetask
+ ADD archivedEpoch INT UNSIGNED NULL;
diff --git a/resources/sql/autopatches/20190220.daemon_worker.completed.02.sql b/resources/sql/autopatches/20190220.daemon_worker.completed.02.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20190220.daemon_worker.completed.02.sql
@@ -0,0 +1,3 @@
+ALTER TABLE {$NAMESPACE}_worker.worker_activetask
+ ADD dateCreated int unsigned NOT NULL,
+ ADD dateModified int unsigned NOT NULL;
diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
--- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
+++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
@@ -12,7 +12,6 @@
$config = array(
self::CONFIG_IDS => self::IDS_COUNTER,
- self::CONFIG_TIMESTAMPS => false,
self::CONFIG_KEY_SCHEMA => array(
'taskClass' => array(
'columns' => array('taskClass'),
@@ -118,7 +117,10 @@
->setPriority($this->getPriority())
->setObjectPHID($this->getObjectPHID())
->setResult($result)
- ->setDuration($duration);
+ ->setDuration($duration)
+ ->setDateCreated($this->getDateCreated())
+ ->setDateModified($this->getDateModified())
+ ->setArchivedEpoch(PhabricatorTime::getNow());
// NOTE: This deletes the active task (this object)!
$archive->save();
diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php
--- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php
+++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php
@@ -8,6 +8,7 @@
protected $duration;
protected $result;
+ protected $archivedEpoch;
protected function getConfiguration() {
$parent = parent::getConfiguration();
@@ -22,6 +23,7 @@
$config[self::CONFIG_COLUMN_SCHEMA] = array(
'result' => 'uint32',
'duration' => 'uint64',
+ 'archivedEpoch' => 'epoch?',
) + $config[self::CONFIG_COLUMN_SCHEMA];
$config[self::CONFIG_KEY_SCHEMA] = array(

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 15, 10:40 AM (2 d, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6725552
Default Alt Text
D20200.id48231.diff (2 KB)

Event Timeline