3
3
namespace Studio \Totem \Providers ;
4
4
5
5
use Illuminate \Console \Scheduling \Schedule ;
6
- use Illuminate \Support \Facades \Storage ;
7
6
use Illuminate \Support \ServiceProvider ;
8
7
use Studio \Totem \Events \Executed ;
9
8
use Studio \Totem \Events \Executing ;
@@ -34,10 +33,6 @@ public function schedule(Schedule $schedule)
34
33
{
35
34
$ tasks = app ('totem.tasks ' )->findAllActive ();
36
35
37
- Storage::makeDirectory (config ('totem.log_folder ' ));
38
-
39
- Storage::put (config ('totem.log_folder ' ).'/test.txt ' , 'abcdegf ' );
40
-
41
36
$ tasks ->each (function ($ task ) use ($ schedule ) {
42
37
$ event = $ schedule ->command ($ task ->command , $ task ->compileParameters (true ));
43
38
@@ -48,10 +43,9 @@ public function schedule(Schedule $schedule)
48
43
$ event ->start = microtime (true );
49
44
Executing::dispatch ($ task );
50
45
})
51
- ->after (function () use ($ event , $ task ) {
52
- Executed::dispatch ($ task , $ event ->start ?? microtime (true ));
53
- })
54
- ->sendOutputTo (Storage::path ($ task ->getMutexName ()));
46
+ ->thenWithOutput (function ($ output ) use ($ event , $ task ) {
47
+ Executed::dispatch ($ task , $ event ->start ?? microtime (true ), $ output );
48
+ });
55
49
if ($ task ->dont_overlap ) {
56
50
$ event ->withoutOverlapping ();
57
51
}
0 commit comments