Skip to content

Commit

Permalink
Allow lambda instance to provide an activity timeout time (#16409)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryWilber authored Jul 20, 2023
1 parent c2b1b4e commit 8f6c793
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export class DocumentPartition {
}

private updateActivityTime() {
this.activityTimeoutTime = Date.now() + this.activityTimeout;
this.activityTimeoutTime =
Date.now() + (this.lambda?.activityTimeout ?? this.activityTimeout);
}
}
6 changes: 6 additions & 0 deletions server/routerlicious/packages/services-core/src/lambdas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export interface IContext {
}

export interface IPartitionLambda {
/**
* Expire document partition after this long of no activity.
* When undefined, the default global IDocumentLambdaServerConfiguration.partitionActivityTimeout is used.
*/
readonly activityTimeout?: number;

/**
* Processes an incoming message
*/
Expand Down

0 comments on commit 8f6c793

Please sign in to comment.