Skip to content

Commit 0e86ecb

Browse files
committed
Delete outdated subscriptions
1 parent 35bfc4e commit 0e86ecb

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
@@ -323,7 +323,7 @@ impl StorageAdapter {
323323

324324
fn delete_outdated_subscriptions(&self) -> Result<(), PowerSyncError> {
325325
self.db
326-
.exec_safe("DELETE FROM ps_stream_subscriptions WHERE expires_at < unixepoch()")?;
326+
.exec_safe("DELETE FROM ps_stream_subscriptions WHERE (expires_at < unixepoch()) OR (ttl IS NULL AND NOT active)")?;
327327
Ok(())
328328
}
329329

0 commit comments

Comments
 (0)