When queueing is off, restore runs immediately. Indicate that we've already finished processing on the success page in this case; otherwise continue to show the 'will take a few minutes' message.
This commit is contained in:
parent
464e0f8115
commit
d5c2b0d216
@ -48,6 +48,7 @@ if (!defined('STATUSNET')) {
|
|||||||
class RestoreaccountAction extends Action
|
class RestoreaccountAction extends Action
|
||||||
{
|
{
|
||||||
private $success = false;
|
private $success = false;
|
||||||
|
private $inprogress = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the title of the page
|
* Returns the title of the page
|
||||||
@ -208,8 +209,13 @@ class RestoreaccountAction extends Action
|
|||||||
$qm = QueueManager::get();
|
$qm = QueueManager::get();
|
||||||
$qm->enqueue(array(common_current_user(), $xml, false), 'feedimp');
|
$qm->enqueue(array(common_current_user(), $xml, false), 'feedimp');
|
||||||
|
|
||||||
$this->success = true;
|
if ($qm instanceof UnQueueManager) {
|
||||||
|
// No active queuing means we've actually just completed the job!
|
||||||
|
$this->success = true;
|
||||||
|
} else {
|
||||||
|
// We've fed data into background queues, and it's probably still running.
|
||||||
|
$this->inprogress = true;
|
||||||
|
}
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@ -228,6 +234,9 @@ class RestoreaccountAction extends Action
|
|||||||
function showContent()
|
function showContent()
|
||||||
{
|
{
|
||||||
if ($this->success) {
|
if ($this->success) {
|
||||||
|
$this->element('p', null,
|
||||||
|
_('Feed has been restored. Your old posts should now appear in search and your profile page.'));
|
||||||
|
} else if ($this->inprogress) {
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
_('Feed will be restored. Please wait a few minutes for results.'));
|
_('Feed will be restored. Please wait a few minutes for results.'));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user