Skip to content

Commit

Permalink
Also enable PITR and abort() APIs without "experimental".
Browse files Browse the repository at this point in the history
Point-in-time recovery is only supported for SQLite-backed DOs in production; PITR methods will throw for non-SQLite namespaces.

abort() will work for all DOs. I think we've generally agreed this should be made public, but it's especially needed with the PITR APIs since you need a way to restart the object immediately after calling `onNextSessionRestoreBookmark()`.
  • Loading branch information
kentonv committed Sep 5, 2024
1 parent 4aec38f commit 66070e3
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/workerd/api/actor-state.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,9 @@ class DurableObjectStorage: public jsg::Object, public DurableObjectStorageOpera
JSG_LAZY_INSTANCE_PROPERTY(sql, getSql);
JSG_METHOD(transactionSync);

if (flags.getWorkerdExperimental()) {
JSG_METHOD(getCurrentBookmark);
JSG_METHOD(getBookmarkForTime);
JSG_METHOD(onNextSessionRestoreBookmark);
}
JSG_METHOD(getCurrentBookmark);
JSG_METHOD(getBookmarkForTime);
JSG_METHOD(onNextSessionRestoreBookmark);

JSG_TS_OVERRIDE({
get<T = unknown>(key: string, options?: DurableObjectGetOptions): Promise<T | undefined>;
Expand Down Expand Up @@ -503,12 +501,7 @@ class DurableObjectState: public jsg::Object {
JSG_METHOD(getHibernatableWebSocketEventTimeout);
JSG_METHOD(getTags);

if (flags.getWorkerdExperimental()) {
// TODO(someday): This currently exists for testing purposes only but maybe it could be
// useful to apps in actual production? It's a convenient way to bail out when you discover
// your state is inconsistent.
JSG_METHOD(abort);
}
JSG_METHOD(abort);

JSG_TS_ROOT();
JSG_TS_OVERRIDE({
Expand Down

0 comments on commit 66070e3

Please sign in to comment.