Mail: [email protected] Phone: +1(424)231-4091

Queues Jobs Are Disabled

To perform heavy or repetitive tasks, NexoPOS needs to enable queues. This ensures NexoPOS performs those tasks without affecting his performance. By default, NexoPOS works in sync, meaning most tasks are executed in runtime, so it's not required to enable this for NexoPOS to work, however, it's ideal to set this up. Regarding Cron jobs, it's important to set that up as it's used for:

  • Trigger scheduled transactions
  • Clear expired orders
  • Detect low-stock products
  • Perform system checks
  • And much more

We're then dealing here with two distinct but complementary features. We'll go over the configuration of each.

Configuring CronJob

It will be easy or hard to configure the cron job depending on your environment. On Windows (not WSL), you'll have to deal with scheduled tasks, which we believe is a not-so-convenient approach (that's the reason why for background tasks, Windows is not recommended) however, if you're dealing with WSL (Windows Subsystem for Linux) or any other Linux distro.

Cron Jobs on cPanel

To get started, on the search bar on your cPanel, you'll search for cronjobs, if no result appears, you might not be allowed to setup cronjob (contact your provider for more details on that). When you click on the cronjob menu, you'll land on a new page.

We'll make sure to setup the job to run every minute, day, hour, month, and weekday. The command to run is

cd  /home/user/public_html/nexopos-directory id && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

You'll replace "nexopos-directory" to the name of the actual directory where NexoPOS is installed. Note that on cPanel, /usr/local/bin/php is used to access PHP. You might need to run "which php" to have the path to the PHP binary.

Cron Job on Laravel Forge

If you're using Laravel Forge (which handles Ubuntu instances), you have a convenient UI to create cron jobs.

The code to add on the "command" field is a bit different. Laravel Forge tends to add a version to php (i.e php8.3), so knowing the php assigned to NexoPOS is important.

php8.3 /home/username/nexopos/artisan schedule:run

Make sure to change the path to the current path to NexoPOS. On a terminal inside the NexoPOS directory, you can get the full path by typing the terminal (pwd= print working directory):

pwd 

Cron job on Linux (Ubuntu)

In a Linux distro (Ubuntu more accurately), you'll have to use crontab. With the following command:

crontab -e -u nexocloud

Make sure to replace "nexocloud" with the user for which you want to edit the cronjobs.

Now at the end of the editor that will be opened on the terminal, you'll paste the job command:

* * * * * cd /path/to/nexopos && php artisan schedule:run >> /dev/null 2>&1

Configuring Supervisor

supervisor is used to execute long-running processes in the background. It's ideal to have a smooth experience. There are multiple approaches for using Queues on NexoPOS. As NexoPOS is based on Laravel, you can fully rely on Laravel documentation.