This task is used to cleanup the faxes global database. This is a headless task which runs on a daily timer. Sometimes fax documents are left behind which are stale. Whenever possible these stale fax documents are moved to the appropriate account modb. When the appropriate account MODB or account associated with the document is not available, the documents are deleted from the faxes db.
Since this task only operates on docs that are stale, it does not generate any notifications when it runs.
Final state assignment#
Documents are moved to a final state prior to being copied to the MODB. If a document is missing attachments, is in a provisional state (status is:
prepare, etc), or missing an account ID, it is set to a status of
failed. If an inbound fax is still in a provisional state but the attachment is present, it is set to a
All configuration are in
||Should the cluster run the fax cleanup task||
||The number of documents to process in one fetch operation||
||How many milliseconds to pause between chunk fetches||
||The number of seconds old a document is before it is considered to be stale||
The task currently logs status and changes it makes to the kazoo log file. Logs can be gathered by grepping for
Fill DB script#
A python script was written to test this. The script fills the faxes db of the target couchdb with dummy fax docs containing randomized dates and other values.
This script can be found in community-scripts.