Skip to content

Commit dbce920

Browse files
committed
Delete outdated subscriptions
1 parent 66771bf commit dbce920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/core/src/sync/storage_adapter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ impl StorageAdapter {
350350

351351
fn delete_outdated_subscriptions(&self) -> Result<(), PowerSyncError> {
352352
self.db
353-
.exec_safe("DELETE FROM ps_stream_subscriptions WHERE expires_at < unixepoch()")?;
353+
.exec_safe("DELETE FROM ps_stream_subscriptions WHERE (expires_at < unixepoch()) OR (ttl IS NULL AND NOT active)")?;
354354
Ok(())
355355
}
356356

0 commit comments

Comments
 (0)