| OLD | NEW |
| 1 # coding: utf-8 | 1 # coding: utf-8 |
| 2 # Copyright 2014 The Swarming Authors. All rights reserved. | 2 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed by the Apache v2.0 license that can be | 3 # Use of this source code is governed by the Apache v2.0 license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Tasks definition. | 6 """Tasks definition. |
| 7 | 7 |
| 8 Each user request creates a new TaskRequest. The TaskRequest instance saves the | 8 Each user request creates a new TaskRequest. The TaskRequest instance saves the |
| 9 metadata of the request, e.g. who requested it, when why, etc. It links to the | 9 metadata of the request, e.g. who requested it, when why, etc. It links to the |
| 10 actual data of the request in a TaskProperties. The TaskProperties represents | 10 actual data of the request in a TaskProperties. The TaskProperties represents |
| 11 everything needed to run the task. | 11 everything needed to run the task. |
| 12 | 12 |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 _put_request(request) | 631 _put_request(request) |
| 632 return request | 632 return request |
| 633 | 633 |
| 634 | 634 |
| 635 def validate_priority(priority): | 635 def validate_priority(priority): |
| 636 """Throws ValueError if priority is not a valid value.""" | 636 """Throws ValueError if priority is not a valid value.""" |
| 637 if 0 > priority or MAXIMUM_PRIORITY < priority: | 637 if 0 > priority or MAXIMUM_PRIORITY < priority: |
| 638 raise datastore_errors.BadValueError( | 638 raise datastore_errors.BadValueError( |
| 639 'priority (%d) must be between 0 and %d (inclusive)' % | 639 'priority (%d) must be between 0 and %d (inclusive)' % |
| 640 (priority, MAXIMUM_PRIORITY)) | 640 (priority, MAXIMUM_PRIORITY)) |
| OLD | NEW |