Completed
Push — master ( c9a373...dabed0 )
by Biao
03:29
created
src/Swoole/Timer/TimerTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
             return false;
17 17
         }
18 18
 
19
-        $callback = function (Process $process) use ($swoole, $config, $laravelConfig) {
20
-            $pidfile = dirname($swoole->setting['pid_file']) . '/' . $this->timerPidFile;
19
+        $callback = function(Process $process) use ($swoole, $config, $laravelConfig) {
20
+            $pidfile = dirname($swoole->setting['pid_file']).'/'.$this->timerPidFile;
21 21
             file_put_contents($pidfile, $process->pid);
22 22
             $this->setProcessTitle(sprintf('%s laravels: timer process', $config['process_prefix']));
23 23
             $this->initLaravel($laravelConfig, $swoole);
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
                 if (empty($job->interval())) {
40 40
                     throw new \InvalidArgumentException(sprintf('The interval of %s cannot be empty', get_class($job)));
41 41
                 }
42
-                $runJob = function () use ($job) {
43
-                    $runCallback = function () use ($job) {
44
-                        $this->callWithCatchException(function () use ($job) {
42
+                $runJob = function() use ($job) {
43
+                    $runCallback = function() use ($job) {
44
+                        $this->callWithCatchException(function() use ($job) {
45 45
                             $job->run();
46 46
                         });
47 47
                     };
@@ -57,17 +57,17 @@  discard block
 block discarded – undo
57 57
             }
58 58
 
59 59
             // This timer is used to ensure that timer process does not exit when all timers are cleared.
60
-            $timerIds[] = Timer::tick(3600 * 12 * 1000, function () {
60
+            $timerIds[] = Timer::tick(3600 * 12 * 1000, function() {
61 61
                 // Do nothing.
62 62
             });
63 63
 
64
-            Process::signal(SIGUSR1, function ($signo) use ($config, $timerIds, $process) {
64
+            Process::signal(SIGUSR1, function($signo) use ($config, $timerIds, $process) {
65 65
                 foreach ($timerIds as $timerId) {
66 66
                     if (Timer::exists($timerId)) {
67 67
                         Timer::clear($timerId);
68 68
                     }
69 69
                 }
70
-                Timer::after($config['max_wait_time'] * 1000, function () use ($process) {
70
+                Timer::after($config['max_wait_time'] * 1000, function() use ($process) {
71 71
                     $process->exit(0);
72 72
                 });
73 73
             });
Please login to merge, or discard this patch.