4
0
Эх сурвалжийг харах

perf(storage): Use SKIP LOCKED in ArchiveEntries

This is already the case in cleanupRemovedEntriesNotInFeed
jvoisin 2 сар өмнө
parent
commit
ca7c38a680

+ 3 - 1
internal/storage/entry.go

@@ -458,7 +458,9 @@ func (s *Storage) ArchiveEntries(status string, interval time.Duration, limit in
 					share_code='' AND
 					created_at < now () - $3::interval
 				ORDER BY
-					created_at ASC LIMIT $4
+					created_at ASC
+				FOR UPDATE SKIP LOCKED
+				LIMIT $4
 				)
 	`