-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed daily sending to hourly sending, added builtin cron
- Loading branch information
Bartosz Juraszewski
committed
Apr 22, 2024
1 parent
5862016
commit 283f70c
Showing
7 changed files
with
66 additions
and
17 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
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
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 |
---|---|---|
|
@@ -21,6 +21,6 @@ final class Api extends Model | |
'uninstall_token', | ||
|
||
'payment_url', | ||
'orders_from_days', | ||
'orders_from_hours', | ||
]; | ||
} |
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
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
37 changes: 37 additions & 0 deletions
37
database/migrations/2024_04_22_145042_update_send_timeframe_to_hours.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,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('apis', function (Blueprint $table): void { | ||
$table->unsignedInteger('orders_from_days')->default(48)->change(); | ||
}); | ||
|
||
Schema::table('apis', function (Blueprint $table): void { | ||
$table->renameColumn('orders_from_days', 'orders_from_hours'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('apis', function (Blueprint $table): void { | ||
$table->unsignedInteger('orders_from_hours')->default(2)->change(); | ||
}); | ||
|
||
Schema::table('apis', function (Blueprint $table): void { | ||
$table->renameColumn('orders_from_hours', 'orders_from_days'); | ||
}); | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
FROM escolasoft/php:8.2-heseya | ||
|
||
RUN apt update && apt install cron -y | ||
RUN echo "5 * * * * root $( which php ) /var/www/html/artisan send" >> /etc/cron.d/feed | ||
|
||
COPY . ./ | ||
RUN composer i | ||
RUN chown -R www-data:www-data /var/www/html | ||
|
||
CMD printenv > /etc/environment && service cron start && apache2-foreground |