@@ -241,18 +241,6 @@ internal class OperationRepo(
241
241
queue.forEach { it.operation.translateIds(response.idTranslations) }
242
242
}
243
243
response.idTranslations.values.forEach { _newRecordState .add(it) }
244
- // Stall processing the queue so the backend's DB has to time
245
- // reflect the change before we do any other operations to it.
246
- // NOTE: Future: We could run this logic in a
247
- // coroutineScope.launch() block so other operations not
248
- // effecting this these id's can still be done in parallel,
249
- // however other parts of the system don't currently account
250
- // for this so this is not safe to do.
251
- val waitTime = _configModelStore .model.opRepoPostCreateDelay
252
- delay(waitTime)
253
- synchronized(queue) {
254
- if (queue.isNotEmpty()) waiter.wake(LoopWaiterMessage (false , waitTime))
255
- }
256
244
}
257
245
258
246
var highestRetries = 0
@@ -316,7 +304,11 @@ internal class OperationRepo(
316
304
}
317
305
}
318
306
307
+ // wait for retry and post create waiters to start next operation
319
308
delayBeforeNextExecution(highestRetries, response.retryAfterSeconds)
309
+ if (response.idTranslations != null ) {
310
+ delayForPostCreate(_configModelStore .model.opRepoPostCreateDelay)
311
+ }
320
312
} catch (e: Throwable ) {
321
313
Logging .log(LogLevel .ERROR , " Error attempting to execute operation: $ops " , e)
322
314
@@ -345,6 +337,22 @@ internal class OperationRepo(
345
337
}
346
338
}
347
339
340
+ /* *
341
+ * Stall processing the queue so the backend's DB has to time
342
+ * reflect the change before we do any other operations to it.
343
+ * NOTE: Future: We could run this logic in a
344
+ * coroutineScope.launch() block so other operations not
345
+ * effecting this these id's can still be done in parallel,
346
+ * however other parts of the system don't currently account
347
+ * for this so this is not safe to do.
348
+ */
349
+ suspend fun delayForPostCreate (postCreateDelay : Long ) {
350
+ delay(postCreateDelay)
351
+ synchronized(queue) {
352
+ if (queue.isNotEmpty()) waiter.wake(LoopWaiterMessage (false , postCreateDelay))
353
+ }
354
+ }
355
+
348
356
internal fun getNextOps (bucketFilter : Int ): List <OperationQueueItem >? {
349
357
return synchronized(queue) {
350
358
val startingOp =
0 commit comments