This commit is contained in:
salam committed 2026-08-18 18:39:34 +02:00
1 parent 537dad3327
commit ff5d8bda1b
3 files changed
+20 -8

No files matched your search

+10 -5
View File
@@ -56,6 +56,7 @@ class Grap extends Command
switch (self::$options['id']) { switch (self::$options['id']) {
case 1: case 1:
// DAILY
SetStorage::set(1); SetStorage::set(1);
// MoveToArchive::move(1); // MoveToArchive::move(1);
@@ -67,20 +68,24 @@ class Grap extends Command
SendMail::run(1); SendMail::run(1);
break; break;
// case 2: case 2:
// SetStorage::set(); // DATE
// SetStorage::set();
// Grapper::load(2); // Grapper::load(2);
// break; break;
case 3: case 3:
// RANGE
SetStorage::set(3); SetStorage::set(3);
// Grapper::load(3); Grapper::load(3);
MakeExcel::create(); MakeExcel::create();
break; break;
case 4: case 4:
// ROSE
SetStorage::set(4); SetStorage::set(4);
Rose::run(); Rose::run();
@@ -42,6 +42,7 @@ class SetStorage
case 4: case 4:
Grap::$storage = $sofascore_data . $storage_name; Grap::$storage = $sofascore_data . $storage_name;
Grap::$folder = 'rosa-' . Carbon::now()->format('Y-m-d'); Grap::$folder = 'rosa-' . Carbon::now()->format('Y-m-d');
Grap::$excel = Grap::$storage . '/rosa-' . Carbon::now()->format('Y-m-d');
break; break;
case 5: case 5:
Grap::$storage = $sofascore_data; Grap::$storage = $sofascore_data;
@@ -54,8 +55,8 @@ class SetStorage
} }
if ($debug) { if ($debug) {
Notice::note(Grap::$folder, 'bb'); Notice::note(Grap::$folder, 'g');
Notice::note(Grap::$storage); // Notice::note(Grap::$storage);
sleep(4); sleep(4);
} }
} }
@@ -17,12 +17,18 @@ class Rose
$debug = Grap::$options['d'] ?? 0; $debug = Grap::$options['d'] ?? 0;
$restart = Grap::$options['r'] ?? 0; $restart = Grap::$options['r'] ?? 0;
if ($debug && !$restart) {
Notice::note("RESTART ?", 'bb');
sleep(5);
}
File::makeDirectory(Grap::$storage . '/' . Grap::$folder, 0775, true, true); File::makeDirectory(Grap::$storage . '/' . Grap::$folder, 0775, true, true);
if ($restart) { if ($restart) {
SofaScoreRosa::query()->update(['grapped' => 0]); SofaScoreRosa::query()->update(['grapped' => 0]);
if ($debug) { if ($debug) {
Notice::note('restarted grapper', 'bb'); Notice::note('reset all grapped to 0', 'r', 1);
} }
} else { } else {
if ($debug) { if ($debug) {