Skip to content

Commit

Permalink
boop
Browse files Browse the repository at this point in the history
  • Loading branch information
threepointone committed Dec 30, 2024
1 parent 97f1211 commit 2beb552
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions fixtures/todo-sync/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ export class ToDos extends SyncServer<Env, TodoRecord, TodoAction> {
)`);
}

onConnect(
connection: Connection,
ctx: ConnectionContext
): void | Promise<void> {}
async onAction(action: TodoAction): Promise<TodoRecord[]> {
// uncomment this if you want to run actions sequentially
// return this.ctx.blockConcurrencyWhile(async () => {
Expand Down Expand Up @@ -95,7 +91,8 @@ export class ToDos extends SyncServer<Env, TodoRecord, TodoAction> {
// });
}
async alarm() {
// delete any todos that have been deleted more than 24 hours ago
// actually delete any todos that have been
// marked as deleted more than 24 hours ago
this.sql(
"DELETE FROM todos WHERE deleted_at < ?",
Date.now() - 24 * 60 * 60 * 1000
Expand Down
2 changes: 1 addition & 1 deletion packages/partysync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type RecordType = [

// NOTE: we do soft deletes so we can sync deleted records to the client

export class MyServer extends SyncServer<Env, Action, RecordType> {
export class MyServer extends SyncServer<Env, RecordType, Action> {
constructor(state: DurableObjectState, env: Env) {
super(state, env);
// setup a database table for your records
Expand Down

0 comments on commit 2beb552

Please sign in to comment.