index: fix parallelization
Signed-off-by: Varun Patil <varunpatil@ucla.edu>pull/579/head
parent
e0eea4c89a
commit
d99647291a
|
@ -20,6 +20,8 @@ Note: this is a major release and may introduce breaking changes to your workflo
|
|||
- All media files (excluding folders with `.nomedia` files, default and recommended)
|
||||
- All files in every user's configured timeline folder (not recommended).
|
||||
- All files in a given folder for each user (relative path).
|
||||
- **Feature**: You can now run indexing in parallel on multiple threads.
|
||||
`for i in {1..4}; do (occ memories:index &); done`
|
||||
- **Feature**: Image editing is now done server-side, and is much faster and more reliable.
|
||||
- PHP Imagick extension is now required for image editing.
|
||||
- This fixes multiple issues editing images especially in Firefox.
|
||||
|
|
|
@ -59,12 +59,14 @@ class TimelineWrite
|
|||
|
||||
// Check if we need to lock the file
|
||||
if ($lock) {
|
||||
$lockKey = 'memories/'.$file->getId();
|
||||
$lockKey = '/memories/'.$file->getId();
|
||||
$lockType = ILockingProvider::LOCK_EXCLUSIVE;
|
||||
|
||||
try {
|
||||
// Throw directly to caller if we can't get the lock
|
||||
// This way we don't release someone else's lock
|
||||
$this->lockingProvider->acquireLock($lockKey, $lockType);
|
||||
|
||||
try {
|
||||
return $this->processFile($file, false, $force);
|
||||
} finally {
|
||||
$this->lockingProvider->releaseLock($lockKey, $lockType);
|
||||
|
|
|
@ -191,7 +191,7 @@ class Index
|
|||
$this->log("Indexing file {$path}", true);
|
||||
$this->timelineWrite->processFile($file);
|
||||
} catch (\OCP\Lock\LockedException $e) {
|
||||
$this->log("Skipping file {$path} due to lock\n", true);
|
||||
$this->log("Skipping file {$path} due to lock", true);
|
||||
} catch (\Exception $e) {
|
||||
$this->error("Failed to index file {$path}: {$e->getMessage()}");
|
||||
} finally {
|
||||
|
|
|
@ -119,6 +119,10 @@
|
|||
<br />
|
||||
<code>occ memories:index</code>
|
||||
<br />
|
||||
{{ t("memories", "Run index in parallel with 4 threads:") }}
|
||||
<br />
|
||||
<code>bash -c 'for i in {1..4}; do (occ memories:index &); done'</code>
|
||||
<br />
|
||||
{{ t("memories", "Force re-indexing of all files:") }}
|
||||
<br />
|
||||
<code>occ memories:index --force</code>
|
||||
|
|
Loading…
Reference in New Issue