Fixed updating last import date for backends.

This commit is contained in:
Abdulmhsen B. A. A
2022-06-27 19:58:04 +03:00
parent 76162a7039
commit f4afd24f2c
2 changed files with 16 additions and 6 deletions

View File

@@ -334,12 +334,15 @@ class ExportCommand extends Command
continue;
}
if (true === (bool)Data::get(sprintf('%s.has_errors', $name))) {
$this->logger->notice(
sprintf('%s: Not updating last export date. Backend reported an error.', $name)
);
} else {
if (false === (bool)Data::get("{$name}.has_errors", false)) {
Config::save(sprintf('servers.%s.export.lastSync', $name), time());
} else {
$this->logger->warning(
'SYSTEM: Not updating last export date for [%(backend)]. Backend reported an error.',
[
'backend' => $name,
]
);
}
}

View File

@@ -249,8 +249,15 @@ class ImportCommand extends Command
$inDryMode = $this->mapper->inDryRunMode() || ag($server, 'options.' . Options::DRY_RUN);
if (false === Data::get(sprintf('%s.has_errors', $name)) && false === $inDryMode) {
if (false === (bool)Data::get("{$name}.has_errors", false) && false === $inDryMode) {
Config::save(sprintf('servers.%s.import.lastSync', $name), time());
} else {
$this->logger->warning(
'SYSTEM: Not updating last import date for [%(backend)]. Backend reported an error.',
[
'backend' => $name,
]
);
}
}