oak-pay-business/lib/watchers/ship.js

37 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const QUERY_PAYING_STATE_GAP = process.env.NODE_ENV === 'production' ? 3600 * 1000 : 60 * 1000;
const watchers = [
// {
// name: '对shipping状态的物流同步其真实状态',
// entity: 'ship',
// filter: async () => {
// const now = Date.now();
// return {
// type: 'express',
// iState: 'shipping',
// $$updateAt$$: {
// $lte: now - QUERY_PAYING_STATE_GAP,
// },
// };
// },
// projection: shipProjection,
// fn: async (context, data) => {
// const results = [] as OperationResult<EntityDict>[];
// for (const ship of data) {
// const result = await refreshShipState(ship.id!, context);
// if (result) {
// results.push(result);
// }
// }
// if (results.length === 0) {
// return {};
// }
// return results.reduce(
// (prev, cur) => mergeOperationResult(prev, cur)
// );
// }
// }
];
exports.default = watchers;