Skip to content

Commit

Permalink
chore: change default max retry count to 5 (from 10)
Browse files Browse the repository at this point in the history
  • Loading branch information
SegaraRai committed Jan 8, 2025
1 parent d46c49a commit 3c91aed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-fireants-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fraci": patch
---

Changed default max retry count to 5 (from 10).
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ const prisma = new PrismaClient().$extends(
// "anotherTable.anotherColumn": { ... },
} as const,
// The maximum number of retries to generate a new fractional index when a conflict occurs.
// The default is 10.
maxRetries: 10,
// The default is 5.
maxRetries: 5,
// The maximum length of the fractional index.
// Fractional index can be made infinitely long by repeating certain operations.
// To prevent attacks by malicious users, fraci allows a maximum length to be specified for stopping new creation.
Expand Down
2 changes: 1 addition & 1 deletion src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { FractionalIndex } from "./lib/types.js";
import { createDigitBaseMap, createIntegerLengthBaseMap } from "./lib/utils.js";

export const DEFAULT_MAX_LENGTH = 50;
export const DEFAULT_MAX_RETRIES = 10;
export const DEFAULT_MAX_RETRIES = 5;

/**
* Fractional index pattern for demonstration.
Expand Down
2 changes: 1 addition & 1 deletion src/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export interface FraciExtensionOptions {
/**
* The maximum number of retries to generate a fractional index.
*
* @default 10
* @default 5
*/
readonly maxRetries?: number;

Expand Down

0 comments on commit 3c91aed

Please sign in to comment.