- The new task has not been added to the beat application yet.
- Added an updated_at column to the monthly billing table, we may want to only calculate from the last updated date rather than the entire month.
when functions get as big as that, it's confusing to try and work out what
things are what. By including a * as the first arg, we require that anyone
calling the function has to use kwargs to reference the parameters
similar to sms/email, however, for consistency with response values
and internal storage, rather than supplying an "email_address" field
or a "phone_number" field, supply an "address_line_1" and "postcode"
field within the personalisation object.
This is still a work in progress but it would be good to get some eyes on it.
This commit includes creating and updating a row in the monthly billing table and a method to fetch the results.
There is a command to populate the monthly billing for a service and month so we can try it out.
The total cost at the moment are wrong, they do not take into account the free allowance - see notes below about adding that to the table.
Left to do:
create a nightly task to run to update the monthly totals.
create an endpoint to return the yearly billing, the current day will need to be calculated on the fly and added to the totals.
Add the free allowance into the total costs.
This pulls in the most recent version of celery/kombu/master - it
prevents situations where the celery MainProcess would consume 100%
CPU while not distributing any tasks to the workers.
Note: If, locally, you already have kombu==4.0.2, you'll have to run
pip install --upgrade https://github.com/celery/kombu/zipball/b2f21289
to get the new version.
We don't use boto2 on the api anymore, not since celery 4.0.2
Note - if you run locally with boto2 still installed you'll see errors
that complain about things like:
boto.exception.SQSError: SQSError: 403 Forbidden
<?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>SignatureDoesNotMatch</Code><Message>Credential should be scoped to a valid region, not 'queue'. </Message><Detail/></Error><RequestId>52207ca4-9131-58cb-89ae-2d45f06623a3</RequestId></ErrorResponse>
If so, make sure boto2 is completely uninstalled.
Kombu is a library that celery uses under the hood. Kombu is pinned to
a specific commit that brings in fixes for SQS - see
https://github.com/celery/kombu/pull/693. Kombu v4.0.2 (which ships
with celery v4.0.2) doesn't work with SQS due to problems with their
use of boto2, so Kombu migrated to boto3 - We're waiting for that to
get a release version, and then to get a new version of celery that
pulls that in. Until that point, we should override the kombu version
to get these SQS fixes.
Additionally, we don't need boto2 any more :)
This can be useful information when debugging what happened to a notificaiton.
Recently there was a discrepancy between the failure type used by each provider for a particular number, this logging would have helped.