added more specific batch keys
This commit is contained in:
parent
ed326c025e
commit
a7ec942916
1 changed files with 9 additions and 2 deletions
|
|
@ -176,7 +176,7 @@ async function processBatched<T>(
|
|||
type: 'process-batch',
|
||||
service: options.service || 'generic',
|
||||
provider: options.provider || 'generic',
|
||||
operation: options.operation || 'generic',
|
||||
operation: 'process-batch-items',
|
||||
payload: {
|
||||
payloadKey,
|
||||
batchIndex,
|
||||
|
|
@ -280,7 +280,14 @@ async function storePayload<T>(
|
|||
options: ProcessOptions
|
||||
): Promise<string> {
|
||||
const cache = getCache();
|
||||
const key = `payload_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
||||
|
||||
// Create more specific key: batch:provider:operation:payload_timestamp_random
|
||||
const timestamp = Date.now();
|
||||
const randomId = Math.random().toString(36).substr(2, 9);
|
||||
const provider = options.provider || 'generic';
|
||||
const operation = options.operation || 'generic';
|
||||
|
||||
const key = `${provider}:${operation}:payload_${timestamp}_${randomId}`;
|
||||
|
||||
const payload = {
|
||||
items,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue