mirror of
https://github.com/friendica/friendica
synced 2024-11-11 19:42:54 +00:00
Merge pull request #10037 from fabrixxm/fix-storage
Storage: small fixes to 'storage move'
This commit is contained in:
commit
4ddc38545b
2 changed files with 6 additions and 1 deletions
|
@ -23,6 +23,7 @@ namespace Friendica\Console;
|
||||||
|
|
||||||
use Asika\SimpleConsole\CommandArgsException;
|
use Asika\SimpleConsole\CommandArgsException;
|
||||||
use Friendica\Core\StorageManager;
|
use Friendica\Core\StorageManager;
|
||||||
|
use Friendica\Model\Storage\StorageException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tool to manage storage backend and stored data from CLI
|
* tool to manage storage backend and stored data from CLI
|
||||||
|
@ -165,6 +166,10 @@ HELP;
|
||||||
$current = $this->storageManager->getBackend();
|
$current = $this->storageManager->getBackend();
|
||||||
$total = 0;
|
$total = 0;
|
||||||
|
|
||||||
|
if (is_null($current)) {
|
||||||
|
throw new StorageException(sprintf("Cannot move to legacy storage. Please select a storage backend."));
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$moved = $this->storageManager->move($current, $tables, $this->getOption('n', 5000));
|
$moved = $this->storageManager->move($current, $tables, $this->getOption('n', 5000));
|
||||||
if ($moved) {
|
if ($moved) {
|
||||||
|
|
|
@ -305,7 +305,7 @@ class StorageManager
|
||||||
$data = $source->get($sourceRef);
|
$data = $source->get($sourceRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->logger->info('Save data to new backend.', ['newBackend' => $destination]);
|
$this->logger->info('Save data to new backend.', ['newBackend' => $destination::getName()]);
|
||||||
$destinationRef = $destination->put($data);
|
$destinationRef = $destination->put($data);
|
||||||
$this->logger->info('Saved data.', ['newReference' => $destinationRef]);
|
$this->logger->info('Saved data.', ['newReference' => $destinationRef]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue