def _audit_changes(account, auditors, send_report, debug=True):
 try:
  for au in auditors:
   au.audit_all_objects()
   au.save_issues()
   if send_report:
    report = au.create_report()
    au.email_report(report)
   if jirasync:
    app.logger.info('Syncing {} issues on {} with Jira'.format(au.index, account))
    jirasync.sync_issues([account], au.index)
 except (OperationalError, InvalidRequestError, StatementError) as e:
  app.logger.exception('Database error processing accounts %s, cleaning up session.', account)
  db.session.remove()
  store_exception('scheduler-audit-changes', None, e)

def _audit_changes ( account , auditors , send_report , debug = True ) : try : for au in auditors : au . audit_all_objects ( ) au . save_issues ( ) if send_report : report = au . create_report ( ) au . email_report ( report ) if jirasync : app . logger . info ( 'Syncing {} issues on {} with Jira' . format ( au . index , account ) ) jirasync . sync_issues ( [ account ] , au . index ) except ( OperationalError , InvalidRequestError , StatementError ) as e : app . logger . exception ( 'Database error processing accounts %s, cleaning up session.' , account ) db . session . remove ( ) store_exception ( 'scheduler-audit-changes' , None , e )
runs auditors on all items .