| 177 | } |
| 178 | |
| 179 | ACTOR static Future<Key> addTask(Reference<ReadYourWritesTransaction> tr, |
| 180 | Reference<TaskBucket> taskBucket, |
| 181 | Reference<Task> parentTask, |
| 182 | Key begin, |
| 183 | Key end, |
| 184 | TaskCompletionKey completionKey, |
| 185 | Reference<TaskFuture> waitFor = Reference<TaskFuture>()) { |
| 186 | Key doneKey = wait(completionKey.get(tr, taskBucket)); |
| 187 | auto task = makeReference<Task>(BackupRangeTaskFunc::name, BackupRangeTaskFunc::version, doneKey); |
| 188 | |
| 189 | copyDefaultParameters(parentTask, task); |
| 190 | |
| 191 | task->params[BackupAgentBase::keyBeginKey] = begin; |
| 192 | task->params[BackupAgentBase::keyEndKey] = end; |
| 193 | |
| 194 | if (!waitFor) { |
| 195 | return taskBucket->addTask(tr, |
| 196 | task, |
| 197 | parentTask->params[Task::reservedTaskParamValidKey], |
| 198 | task->params[BackupAgentBase::keyFolderId]); |
| 199 | } |
| 200 | |
| 201 | wait(waitFor->onSetAddTask(tr, |
| 202 | taskBucket, |
| 203 | task, |
| 204 | parentTask->params[Task::reservedTaskParamValidKey], |
| 205 | task->params[BackupAgentBase::keyFolderId])); |
| 206 | return LiteralStringRef("OnSetAddTask"); |
| 207 | } |
| 208 | |
| 209 | ACTOR static Future<Void> _execute(Database cx, |
| 210 | Reference<TaskBucket> taskBucket, |
nothing calls this directly
no test coverage detected