-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tec: Execute Cleaner job at 01:00 AM
The jobs have been reset during the last refactor. The Cleaner job was mean't to be executed at 1:00 AM, but it wasn't done correctly.
- Loading branch information
1 parent
40a62c3
commit 1f53340
Showing
3 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/migrations/Migration202308030001UpdatePerformAtOfCleanerJob.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace flusio\migrations; | ||
|
||
class Migration202308030001UpdatePerformAtOfCleanerJob | ||
{ | ||
public function migrate(): bool | ||
{ | ||
$database = \Minz\Database::get(); | ||
|
||
$statement = $database->prepare(<<<'SQL' | ||
UPDATE jobs | ||
SET perform_at = ? | ||
WHERE name = 'flusio\jobs\scheduled\Cleaner'; | ||
SQL); | ||
|
||
$perform_at = \Minz\Time::relative('tomorrow 1:00'); | ||
$statement->execute([ | ||
$perform_at->format(\Minz\Database\Column::DATETIME_FORMAT), | ||
]); | ||
|
||
return true; | ||
} | ||
|
||
public function rollback(): bool | ||
{ | ||
// Do nothing on purpose | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters