mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-09-19 16:24:33 +00:00
Allow connector sync between warmup batches
This commit is contained in:
@@ -58,17 +58,11 @@ if (!function_exists('exec'))
|
||||
}
|
||||
|
||||
$worker = realpath(BRATONIEN_TOOLS_PATH.'runtime/lib/webdav-cache-warmup.php');
|
||||
$guard = realpath(BRATONIEN_TOOLS_PATH.'runtime/lib/run-webdav-cache-warmup.sh');
|
||||
if (!$worker || !is_file($worker))
|
||||
{
|
||||
fwrite(STDERR, "WebDAV-Cache-Warmup-Worker wurde nicht gefunden.\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!$guard || !is_file($guard))
|
||||
{
|
||||
fwrite(STDERR, "WebDAV-Cache-Warmup-Schutzskript wurde nicht gefunden.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$log = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'bratonien-webdav-warmup.log';
|
||||
$result = 0;
|
||||
@@ -135,11 +129,11 @@ foreach (bratonien_tools_nc_connector_connections() as $connection)
|
||||
@chmod($priority_file, 0664);
|
||||
}
|
||||
|
||||
// Der Guard hält webdav-sync.lock für den gesamten Worker-Lauf geteilt.
|
||||
// Dadurch kann der produktive Source-/Shadow-Tree während Download, Swap,
|
||||
// Piwigo-Aufruf und Restore nicht von einem Connector-Sync ersetzt werden.
|
||||
$base = escapeshellarg('/bin/bash').' '.escapeshellarg($guard).' '.escapeshellarg($state_dir)
|
||||
.' '.escapeshellarg(PHP_BINARY).' '.escapeshellarg($worker)
|
||||
// Der Worker schützt nur die kurze produktive Materialisierungsphase eines
|
||||
// einzelnen Bildes mit webdav-sync.lock. Downloads und Batchgrenzen bleiben
|
||||
// frei, damit ein Connector-Sync neue Alben erkennen und Stufe 2 sicher
|
||||
// zwischen zwei vollständig restaurierten Batches priorisieren kann.
|
||||
$base = escapeshellarg(PHP_BINARY).' '.escapeshellarg($worker)
|
||||
.' --connection-id='.$connection_id
|
||||
.' --mode='.escapeshellarg($mode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user