PluginProbe
Disk Usage Insights / 1.4
Disk Usage Insights v1.4
trunk 1.0 1.10 1.11 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | src/Frontend/Controller/ScanWorkerController.php +2 -6 1.51.4 View file →
@@ -28,12 +28,11 @@
28 28 }
29 29
30 30 $w = (new Worker($database->q))
31 31 ->withMaxTotalRuntimeInSeconds(5)
32 - ->withSleepTimeBetweenJobsInMilliseconds(0)
33 - ->withSleepTimeOnEmptyQueueInMilliseconds(0)
32 + ->withSleepTimeBetweenJobsInMilliseconds(1)
33 + ->withSleepTimeOnEmptyQueueInMilliseconds(1)
34 34 ;
35 -
36 35 $w->process(function(Job $job) use ($database) {
37 36 $reflect = new \ReflectionClass($job->payload['type']);
38 37 $instance = $reflect->newInstanceArgs($job->payload['args']);
39 38 $instance->setQueue($database->q);
@@ -38,12 +37,9 @@
38 37 $instance = $reflect->newInstanceArgs($job->payload['args']);
39 38 $instance->setQueue($database->q);
40 39 $instance->setFileEntryRepository($database->fileEntryRepository);
41 40 $instance->setSnapshotRepository($database->snapshotRepository);
42 -
43 - $database->q->db->beginTransaction();
44 41 $instance->work();
45 - $database->q->db->commit();
46 42 });
47 43
48 44 wp_die(); // All ajax handlers should die when finished
49 45 }