mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-27 01:19:00 +02:00
feat: add transaction context store
This commit is contained in:
parent
2570fe5e97
commit
a36f1e8b66
@ -5,11 +5,10 @@ export interface OperationContext {
|
||||
id: number;
|
||||
}
|
||||
|
||||
// Generate a numeric transaction ID based on timestamp + random component
|
||||
function generateNumericTransactionId(): number {
|
||||
const timestamp = Date.now(); // 13 digits
|
||||
const random = Math.floor(Math.random() * 1000); // 3 digits max
|
||||
return timestamp * 1000 + random; // Ensures uniqueness
|
||||
const timestamp = Date.now();
|
||||
const random = Math.floor(Math.random() * 1000);
|
||||
return timestamp * 1000 + random;
|
||||
}
|
||||
|
||||
const storage = new AsyncLocalStorage<OperationContext>();
|
||||
|
Loading…
Reference in New Issue
Block a user