]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Update.php
We should execute the worker job for normal situations ;-)
[friendica.git] / src / Core / Update.php
index ed6c058726431e2383cb27a9203674bcad309dc8..b4626c27b3b40e3c9a9649ece851983eb5dc2e41 100644 (file)
@@ -37,9 +37,13 @@ class Update
                }
 
                if ($build < DB_UPDATE_VERSION) {
-                       // When we cannot execute the database update via the worker, we will do it directly
-                       if (!Worker::add(PRIORITY_CRITICAL, 'DBUpdate') && $via_worker) {
+                       if ($via_worker) {
+                               // Calling the database update directly via the worker enables us to perform database changes to the workerqueue table itself.
+                               // This is a fallback, since normally the database update will be performed by a worker job.
+                               // This worker job doesn't work for changes to the "workerqueue" table itself.
                                self::run($basePath);
+                       } else {
+                               Worker::add(PRIORITY_CRITICAL, 'DBUpdate');
                        }
                }
        }