Complete acknowledged generation conversations
This commit is contained in:
parent
c4074f4732
commit
1a373cb3bb
1 changed files with 4 additions and 1 deletions
|
|
@ -21,7 +21,10 @@ internal class SyncGenerationForegroundCoordinator(private val repository: Train
|
|||
repository.inSyncGenerationTransaction { db ->
|
||||
db.rawQuery(
|
||||
"SELECT generation_id,manifest_sha256,staging_path FROM sync_generations " +
|
||||
"WHERE run_id=? AND status IN('captured','published','waiting_acknowledgement') " +
|
||||
"WHERE run_id=? AND (status IN('captured','published','waiting_acknowledgement') " +
|
||||
"OR (status='acknowledged' AND NOT EXISTS(" +
|
||||
"SELECT 1 FROM sync_consumed_generations c WHERE c.run_id=sync_generations.run_id " +
|
||||
"AND c.result IN('consumed','rejected')))) " +
|
||||
(if (consumerPeerId == null) "" else "AND consumer_peer_id=? ") +
|
||||
"LIMIT 2",
|
||||
if (consumerPeerId == null) arrayOf(runId) else arrayOf(runId, consumerPeerId),
|
||||
|
|
|
|||
Loading…
Reference in a new issue