batch_job — Camelot documentation

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- model »

# batch_job

Most applications need to perform some scheduled jobs to process information. Users need to be able to monitor the functioning of those scheduled jobs.

These classes provide the means to store the result of batch jobs to enable the user to review or plan them.

class `camelot.model.batch_job.` `BatchJob`(**kwargs)

  Information the batch job that is planned, running or has run

  Fields :

  > - status : INTEGER, required
  > - host : VARCHAR(256), required
  > - date : <class ‘sqlalchemy.types.DateTime’>, required
  > - message : TEXT, not required
  > - type : refers to BatchJobType

  `add_exception_to_message`(exception)

    If an exception occurs in a batch job, this method can be used to add the stack trace of the exception to the message

  `add_strings_to_message`(strings)

    Parameters: | strings – a list or generator of strings

  `is_canceled`()

    Verifies if this Batch Job is canceled. Returns `True` if it is. This verification is done without using the ORM, so the verification has no impact on the current session or the objects itself. This method is thus suited to call inside a running batch job to verifiy if another user has canceled the running job.

    Returns: | `True` or `False`

class `camelot.model.batch_job.` `BatchJobType`(**kwargs)
  The type of batch job, the user will be able to filter his
    jobs based on their type. A type might be ‘Create management reports’

  Fields :

  > - name : VARCHAR(256), required
  > - parent : refers to BatchJobType

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- model »

Comments
blog comments powered by Disqus