equal
deleted
inserted
replaced
74 order = ['-priority'] |
74 order = ['-priority'] |
75 query = priority_group_logic.getQueryForFields(order=order) |
75 query = priority_group_logic.getQueryForFields(order=order) |
76 groups = priority_group_logic.getAll(query) |
76 groups = priority_group_logic.getAll(query) |
77 handler = soc.cron.job.handler |
77 handler = soc.cron.job.handler |
78 |
78 |
79 groups_completed = 0 |
79 groups_touched = 0 |
80 jobs_completed = 0 |
80 jobs_completed = 0 |
81 |
81 |
82 for group in groups: |
82 for group in groups: |
|
83 groups_touched += 1 |
|
84 |
83 filter = { |
85 filter = { |
84 'priority_group': group, |
86 'priority_group': group, |
85 'status': 'waiting', |
87 'status': 'waiting', |
86 } |
88 } |
87 |
89 |
95 if not good: |
97 if not good: |
96 break |
98 break |
97 |
99 |
98 jobs_completed += 1 |
100 jobs_completed += 1 |
99 |
101 |
100 groups_completed += 1 |
102 response = 'Completed %d jobs in %d priority groups.' % ( |
101 |
103 jobs_completed, groups_touched) |
102 response = 'Completed %d jobs and %d groups completed.' % ( |
|
103 jobs_completed, groups_completed) |
|
104 |
104 |
105 return http.HttpResponse(response) |
105 return http.HttpResponse(response) |
106 |
106 |
107 |
107 |
108 view = View() |
108 view = View() |