diff options
author | Mario <mario@mariovavti.com> | 2024-04-05 10:40:16 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-04-05 10:40:16 +0000 |
commit | a56d727c2665a80965a1f331bc6423f314d79f6e (patch) | |
tree | ca3bf27a788133a5747e19f63c5d411a860f6744 | |
parent | fe43e0994f3bc3d5b629942bb4c56b65524e8e79 (diff) | |
download | volse-hubzilla-a56d727c2665a80965a1f331bc6423f314d79f6e.tar.gz volse-hubzilla-a56d727c2665a80965a1f331bc6423f314d79f6e.tar.bz2 volse-hubzilla-a56d727c2665a80965a1f331bc6423f314d79f6e.zip |
allow to kick off sync process in case it did not start at all. requires import host to be set manually in pconfig for now.
-rw-r--r-- | Zotlabs/Module/Import_progress.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Zotlabs/Module/Import_progress.php b/Zotlabs/Module/Import_progress.php index 5c68f9ff1..d9b13e8a8 100644 --- a/Zotlabs/Module/Import_progress.php +++ b/Zotlabs/Module/Import_progress.php @@ -1,6 +1,7 @@ <?php namespace Zotlabs\Module; +use App; use Zotlabs\Lib\PConfig; use Zotlabs\Daemon\Master; @@ -21,6 +22,9 @@ class Import_progress extends \Zotlabs\Web\Controller { nav_set_selected('Channel Import'); + $channel = App::get_channel(); + $import_host = PConfig::Get(local_channel(), 'import', 'host'); + // items $c = PConfig::Get(local_channel(), 'import', 'content_progress'); @@ -41,6 +45,24 @@ class Import_progress extends \Zotlabs\Web\Controller { } } else { + if(argv(1) === 'resume_itemsync' && $import_host) { + $alive = probe_api_path($import_host); + if ($alive) { + $parsed = parse_url($alive); + unset($parsed['path']); + + $hz_server = unparse_url($parsed); + $since = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), '0001-01-01 00:00'); + $until = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), 'now + 1 day'); + $page = 0; + Master::Summon(['Content_importer', sprintf('%d', $page), $since, $until, $channel['channel_address'], urlencode($hz_server)]); + goaway('/import_progress'); + } + else { + notice(t('Import host does not seem to be online or compatible') . EOL); + } + } + $cprogress = 'waiting to start...'; if (PConfig::Get(local_channel(), 'import', 'content_completed')) { @@ -73,6 +95,23 @@ class Import_progress extends \Zotlabs\Web\Controller { } } else { + if(argv(1) === 'resume_filesync' && $import_host) { + $alive = probe_api_path($import_host); + if ($alive) { + $parsed = parse_url($alive); + unset($parsed['path']); + + $hz_server = unparse_url($parsed); + $page = 0; + + Master::Summon(['File_importer', sprintf('%d', $page), $channel['channel_address'], urlencode($hz_server)]); + goaway('/import_progress'); + } + else { + notice(t('Import host does not seem to be online or compatible') . EOL); + } + } + $fprogress = 'waiting to start...'; if (PConfig::Get(local_channel(), 'import', 'files_completed')) { |