Conditions | 4 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 1 |
CRAP Score | 15.664 |
Changes | 0 |
1 | 1 | from plugin.models import SyncResult |
|
38 | 1 | def run(self, job): |
|
39 | # Ensure sync hasn't already been triggered |
||
40 | if not self.check(job): |
||
41 | return False |
||
42 | |||
43 | try: |
||
44 | # Queue sync |
||
45 | Sync.queue( |
||
46 | account=job.account, |
||
47 | mode=SyncMode.Full, |
||
48 | |||
49 | priority=100, |
||
50 | trigger=SyncResult.Trigger.Schedule |
||
51 | ) |
||
52 | except QueueError, ex: |
||
53 | log.info('Queue error: %s', ex) |
||
54 | except Exception, ex: |
||
55 | log.error('Unable to queue sync: %s', ex, exc_info=True) |
||
56 | |||
57 | return True |
||
58 |