Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/cloudflare/src/api/durable-objects/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ export class DOQueueHandler extends DurableObject<CloudflareEnv> {

constructor(ctx: DurableObjectState, env: CloudflareEnv) {
super(ctx, env);
this.service = env.WORKER_SELF_REFERENCE!;
// If there is no service binding, we throw an error because we can't revalidate without it
if (!this.service) throw new IgnorableError("No service binding for cache revalidation worker");
if (!env.WORKER_SELF_REFERENCE) {
throw new IgnorableError("No service binding for cache revalidation worker");
}
this.service = env.WORKER_SELF_REFERENCE;
this.sql = ctx.storage.sql;

this.maxRevalidations = env.NEXT_CACHE_DO_QUEUE_MAX_REVALIDATION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface WithFilterOptions {
* @param tag The tag to filter.
* @returns true if the tag should be forwarded, false otherwise.
*/
filterFn: (tag: string | NextModeTagCacheWriteInput) => boolean;
filterFn: (tag: NextModeTagCacheWriteInput) => boolean;
}

/**
Expand Down Expand Up @@ -69,7 +69,7 @@ export function withFilter({ tagCache, filterFn }: WithFilterOptions): NextModeT
* This is used to filter out internal soft tags.
* Can be used if `revalidatePath` is not used.
*/
export function softTagFilter(tag: string | NextModeTagCacheWriteInput): boolean {
export function softTagFilter(tag: NextModeTagCacheWriteInput): boolean {
if (typeof tag === "string") {
return !tag.startsWith("_N_T_");
}
Expand Down
Loading