Automatic stock sets the stock of a product to the number of servers that still fit on its node.
How the stock is calculated#
For every product with a Node:
- The free memory and disk of the node are read from the panel: the total minus what is allocated to servers.
- The free memory is divided by the Memory of the product, and the free disk by its Disk.
- The lowest of the two is the stock.
- Minimum Stock Buffer is subtracted from it.
Products without a node, or without memory or disk set, are skipped.
Turn it on#
- Edit your server under Extensions → Servers.
- Turn on Enable Automatic Stock Calculation.
- Set Update Interval, between 5 and 1440 minutes.
- Set a Node on every product that should get automatic stock.
The update runs through the Paymenter cron job:
* * * * * php /var/www/paymenter/artisan schedule:run >> /dev/null 2>&1
Run it by hand#
cd /var/www/paymenter
php artisan betterpterodactyl:update-stock
| Argument or option | What it does |
|---|---|
42 |
Updates only the product with ID 42 |
--dry-run |
Shows the new stock without saving it |