Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4852666
PhabricatorWorkerManagementRetryWorkflow.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorWorkerManagementRetryWorkflow.php
View Options
<?php
final
class
PhabricatorWorkerManagementRetryWorkflow
extends
PhabricatorWorkerManagementWorkflow
{
protected
function
didConstruct
(
)
{
$this
->
setName
(
'retry'
)
->
setExamples
(
'**retry** --id __id__'
)
->
setSynopsis
(
pht
(
'Retry selected tasks which previously failed permanently or '
.
'were cancelled. Only archived, unsuccessful tasks can be '
.
'retried.'
)
)
->
setArguments
(
$this
->
getTaskSelectionArguments
(
)
)
;
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$console
=
PhutilConsole
::
getConsole
(
)
;
$tasks
=
$this
->
loadTasks
(
$args
)
;
foreach
(
$tasks
as
$task
)
{
if
(
!
$task
->
isArchived
(
)
)
{
$console
->
writeOut
(
"**<bg:yellow> %s </bg>** %s\n"
,
pht
(
'ACTIVE'
)
,
pht
(
'%s is already in the active task queue.'
,
$this
->
describeTask
(
$task
)
)
)
;
continue
;
}
$result_success
=
PhabricatorWorkerArchiveTask
::
RESULT_SUCCESS
;
if
(
$task
->
getResult
(
)
==
$result_success
)
{
$console
->
writeOut
(
"**<bg:yellow> %s </bg>** %s\n"
,
pht
(
'SUCCEEDED'
)
,
pht
(
'%s has already succeeded, and can not be retried.'
,
$this
->
describeTask
(
$task
)
)
)
;
continue
;
}
$task
->
unarchiveTask
(
)
;
$console
->
writeOut
(
"**<bg:green> %s </bg>** %s\n"
,
pht
(
'QUEUED'
)
,
pht
(
'%s was queued for retry.'
,
$this
->
describeTask
(
$task
)
)
)
;
}
return
0
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 9, 06:46 (3 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1768512
Default Alt Text
PhabricatorWorkerManagementRetryWorkflow.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment