ソースを参照

perf(storage): Use SKIP LOCKED in ArchiveEntries

This is already the case in cleanupRemovedEntriesNotInFeed
jvoisin 1 ヶ月 前
コミット
ca7c38a680
1 ファイル変更3 行追加1 行削除
  1. 3 1
      internal/storage/entry.go

+ 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
 				)
 	`