Fleio billing periodic task¶
Fleio billing periodic task is a task that is executed periodically via a celery beat. When run this script will update resource usage for all clients and if needed will generate invoices or automatically settle usage from client credit. The behaviour of this script can be controlled via client configurations.
How it works¶
When run the fleio billing periodic task will do the following operations for each client in the following order:
if client is active will process all client services and generate invoices or settle usage based on client configuration
will process cancellation requests for client services, regardless of client status
will update client usage regardless of client status since even if client is suspended we may still have active services with suspend date overridden
if client is suspended will check if client has enough credit now and if so it will resume the client if it was suspended because not enough credit
if client is active will check credit status and suspend client if suspend conditions match or send out of credit notifications if needed
if client is suspend will check to see if client has some services with suspend overridden and if overridden date has passed those services will be suspended
When to run¶
In order to process usage and suspend clients in a timely manner this periodic task should be run frequently. We recommend running this once every 10-15 minutes.