feat(extension): 采集插件功能开发
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
} from './ozon-client.js';
|
||||
import { decryptStoreSecret } from './store-secret.crypto.js';
|
||||
import { MediaUploadCleanup } from './media-upload-cleanup.js';
|
||||
import { materializeCollectionAssets } from './collection-assets.js';
|
||||
|
||||
const connection = new Redis(workerConfig.redisUrl, {
|
||||
maxRetriesPerRequest: null,
|
||||
@@ -42,6 +43,8 @@ const worker = new Worker<OutboxJob>(
|
||||
await verifyStoreCredentials(database, job.data as OutboxJob & { payload: { store_id: string; operation_id: string; secret_id?: string } });
|
||||
} else if (job.name === 'collection.cleanup.requested') {
|
||||
await cleanupCollection(database, job.data as OutboxJob & { payload: { operation_id: string; collection_item_ids: string[] } });
|
||||
} else if (job.name === 'collection.assets.materialize.requested' || job.name === 'collection.assets.retry.requested') {
|
||||
await materializeCollectionAssets(database, objectStorage, workerConfig.objectStorageBucket, job.data);
|
||||
}
|
||||
},
|
||||
{ connection, concurrency: 5 },
|
||||
|
||||
Reference in New Issue
Block a user