From 2d7e1ec7bf89becc5458ef3531b095bcade9b793 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Tue, 30 Mar 2021 01:36:11 +0900 Subject: [PATCH] redis updates --- app/Jobs/Commands/Eve/ItemPricesUpdateJob.php | 5 +++++ .../Commands/Eve/ProcessSendEveMailJob.php | 5 +++++ .../Commands/Eve/ProcessSendEveMailJobRL.php | 5 +++++ .../FetchMiningTaxesLedgersJob.php | 5 +++++ .../ProcessMiningTaxesLedgersJob.php | 5 +++++ .../ProcessMiningTaxesPaymentsJob.php | 5 +++++ .../SupplyChain/EndSupplyChainContractJob.php | 5 +++++ config/database.php | 22 +++++++++++++++++-- config/queue.php | 20 ++++++++++++++++- 9 files changed, 74 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Commands/Eve/ItemPricesUpdateJob.php b/app/Jobs/Commands/Eve/ItemPricesUpdateJob.php index 6a66e029e..56f62aefc 100644 --- a/app/Jobs/Commands/Eve/ItemPricesUpdateJob.php +++ b/app/Jobs/Commands/Eve/ItemPricesUpdateJob.php @@ -16,6 +16,11 @@ class ItemPricesUpdateJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + /** + * The queue connection that should handle the job + */ + public $connection = 'queue'; + /** * Create a new job instance. * diff --git a/app/Jobs/Commands/Eve/ProcessSendEveMailJob.php b/app/Jobs/Commands/Eve/ProcessSendEveMailJob.php index 284d5488b..2732c0c85 100644 --- a/app/Jobs/Commands/Eve/ProcessSendEveMailJob.php +++ b/app/Jobs/Commands/Eve/ProcessSendEveMailJob.php @@ -29,6 +29,11 @@ class ProcessSendEveMailJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + /** + * The queue connection that should handle the job + */ + public $connection = 'queue'; + /** * Retries * With new rate limiting, we need a retry basis versus timeout basis diff --git a/app/Jobs/Commands/Eve/ProcessSendEveMailJobRL.php b/app/Jobs/Commands/Eve/ProcessSendEveMailJobRL.php index 0dcd547cf..b25a7e046 100644 --- a/app/Jobs/Commands/Eve/ProcessSendEveMailJobRL.php +++ b/app/Jobs/Commands/Eve/ProcessSendEveMailJobRL.php @@ -28,6 +28,11 @@ class ProcessSendEveMailJobRL implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + /** + * The queue connection that should handle the job + */ + public $connection = 'queue'; + /** * Timeout in seconds * With new rate limiting, we shouldn't use this timeout diff --git a/app/Jobs/Commands/MiningTaxes/FetchMiningTaxesLedgersJob.php b/app/Jobs/Commands/MiningTaxes/FetchMiningTaxesLedgersJob.php index c86984849..759e89335 100644 --- a/app/Jobs/Commands/MiningTaxes/FetchMiningTaxesLedgersJob.php +++ b/app/Jobs/Commands/MiningTaxes/FetchMiningTaxesLedgersJob.php @@ -31,6 +31,11 @@ class FetchMiningTaxesLedgersJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + /** + * The queue connection that should handle the job + */ + public $connection = 'queue'; + /** * Timeout in seconds * diff --git a/app/Jobs/Commands/MiningTaxes/ProcessMiningTaxesLedgersJob.php b/app/Jobs/Commands/MiningTaxes/ProcessMiningTaxesLedgersJob.php index f843ed537..5c1fa0b15 100644 --- a/app/Jobs/Commands/MiningTaxes/ProcessMiningTaxesLedgersJob.php +++ b/app/Jobs/Commands/MiningTaxes/ProcessMiningTaxesLedgersJob.php @@ -23,6 +23,11 @@ class ProcessMiningTaxesLedgersJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + /** + * The queue connection that should handle the job + */ + public $connection = 'queue'; + /** * Timeout in seconds * diff --git a/app/Jobs/Commands/MiningTaxes/ProcessMiningTaxesPaymentsJob.php b/app/Jobs/Commands/MiningTaxes/ProcessMiningTaxesPaymentsJob.php index ea00f0a81..fb54c8f13 100644 --- a/app/Jobs/Commands/MiningTaxes/ProcessMiningTaxesPaymentsJob.php +++ b/app/Jobs/Commands/MiningTaxes/ProcessMiningTaxesPaymentsJob.php @@ -23,6 +23,11 @@ class ProcessMiningTaxesPaymentsJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + /** + * The queue connection that should handle the job + */ + public $connection = 'queue'; + /** * Create a new job instance. * diff --git a/app/Jobs/Commands/SupplyChain/EndSupplyChainContractJob.php b/app/Jobs/Commands/SupplyChain/EndSupplyChainContractJob.php index 98ebc798a..58fec9e63 100644 --- a/app/Jobs/Commands/SupplyChain/EndSupplyChainContractJob.php +++ b/app/Jobs/Commands/SupplyChain/EndSupplyChainContractJob.php @@ -24,6 +24,11 @@ class EndSupplyChainContractJob implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + /** + * The queue connection that should handle the job + */ + public $connection = 'queue'; + /** * Timeout in seconds * diff --git a/config/database.php b/config/database.php index febec8727..12878bfe8 100644 --- a/config/database.php +++ b/config/database.php @@ -106,16 +106,34 @@ return [ 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), - 'database' => env('REDIS_DB', 8), + 'database' => env('REDIS_DB', 0), + `prefix` => `d:`, ], 'cache' => [ 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), - 'database' => env('REDIS_CACHE_DB', 9), + 'database' => env('REDIS_CACHE_DB', 0), + `prefix` => `c:`, ], + 'queue' => [ + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', 6379), + 'database' => env('REDIS_QUEUE_DB', 0), + `prefix` => `q:`, + ], + + 'session' => [ + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'password' => env('REDIS_PASSWORD', null), + 'port' => env('REDIS_PORT', 6379), + 'database' => env('REDIS_SESSION_DB', 0), + `prefix` => `myapp:s:`, + ] + ], ]; diff --git a/config/queue.php b/config/queue.php index 37018d028..b5dea8560 100644 --- a/config/queue.php +++ b/config/queue.php @@ -13,7 +13,7 @@ return [ | */ - 'default' => env('QUEUE_CONNECTION', 'redis'), + 'default' => env('QUEUE_CONNECTION', 'sync'), /* |-------------------------------------------------------------------------- @@ -65,6 +65,24 @@ return [ 'block_for' => null, ], + 'job' => [ + 'driver' => 'redis', + 'connection' => 'queue', + 'queue' => '{job}', + 'retry_after' => 90, + 'block_for' => null, + ], + + 'app' => [ + 'driver' => 'redis', + 'connection' => 'queue', + 'queue' => '{app}', + 'rery_after' => 90, + 'block_for' => null, + ], + + + ], /*