@extends('backend.background_tasks.layout') @section('title', __('Scheduler & Queue Guide')) @section('bt_title', __('Scheduler & Queue Guide')) @section('bt_icon', 'schedule') @section('bt_subtitle', __('Instructions for configuring the Laravel scheduler and queue workers on your server.')) @section('bt_content')
@lang('Cron Entry (required)')
@lang('Add this to your server crontab') (crontab -e):
* * * * * cd {{ base_path() }} && php artisan schedule:run >> /dev/null 2>&1
@lang('All 3 commands run every minute via this single cron entry.')
@lang('Queue Worker')
@lang('Start the worker on your server:') @lang('Driver:') {{ config('queue.default') }}
php artisan queue:work --queue=default --tries=3 --timeout=120
@lang('Use Supervisor in production to keep the worker running continuously.')
@lang('Scheduled Commands')
@lang('Signature') @lang('Frequency') @lang('Description')
wallet-earn:process @lang('Every minute') @lang('Process due Wallet Earn reward payouts and matured principal returns.')
p2p:promotions:expire @lang('Every minute') @lang('Expire active P2P offer promotions that passed their end time.')
p2p:orders:expire @lang('Every minute') @lang('Expire pending P2P orders that passed expiry time and refund escrow.')
@lang('Save as') /etc/supervisor/conf.d/laravel-worker.conf, @lang('then run:') supervisorctl reread && supervisorctl update && supervisorctl start laravel-worker:*
[program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php {{ base_path() }}/artisan queue:work --sleep=3 --tries=3 --timeout=120 autostart=true autorestart=true user=www-data numprocs=1 redirect_stderr=true stdout_logfile={{ storage_path('logs/worker.log') }}
@endsection