移除随机延时

This commit is contained in:
cheney
2026-10-21 20:10:19 +08:00
parent 3b79054995
commit 18941236af
2 changed files with 9 additions and 55 deletions
-21
View File
@@ -195,10 +195,6 @@ async function processHotelBill(bill, billIndex, totalBills) {
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId); const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp)); console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
const waitSeconds = randomDelaySeconds();
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
await sleep(waitSeconds * 1000);
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId); const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp)); console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
@@ -240,10 +236,6 @@ async function processFlightBill(bill, billIndex, totalBills) {
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId); const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp)); console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
const waitSeconds = randomDelaySeconds();
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
await sleep(waitSeconds * 1000);
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId); const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp)); console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
@@ -271,10 +263,6 @@ async function processInternationalFlightBill(bill, billIndex, totalBills) {
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId); const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp)); console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
const waitSeconds = randomDelaySeconds();
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
await sleep(waitSeconds * 1000);
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId); const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp)); console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
@@ -292,15 +280,6 @@ async function processInternationalFlightBill(bill, billIndex, totalBills) {
console.log(''); console.log('');
} }
// ========== 13. 随机延时 ==========
function sleep(ms) {
return new Promise(function (resolve) { setTimeout(resolve, ms); });
}
function randomDelaySeconds() {
return Math.floor(15 + Math.random() * 31);
}
// ========== 接口错误检查 ========== // ========== 接口错误检查 ==========
function ensureOk(resp, what) { function ensureOk(resp, what) {
if (resp && resp.code && resp.code !== 'Z000') { if (resp && resp.code && resp.code !== 'Z000') {
-25
View File
@@ -206,10 +206,6 @@ async function processTrainBill(bill, billIndex, totalBills) {
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId); const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp)); console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
const waitSeconds = randomDelaySeconds();
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
await sleep(waitSeconds * 1000);
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId); const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp)); console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
@@ -244,10 +240,6 @@ async function processHotelBill(bill, billIndex, totalBills) {
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId); const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp)); console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
const waitSeconds = randomDelaySeconds();
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
await sleep(waitSeconds * 1000);
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId); const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp)); console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
@@ -289,10 +281,6 @@ async function processFlightBill(bill, billIndex, totalBills) {
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId); const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp)); console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
const waitSeconds = randomDelaySeconds();
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
await sleep(waitSeconds * 1000);
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId); const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp)); console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
@@ -320,10 +308,6 @@ async function processInternationalFlightBill(bill, billIndex, totalBills) {
const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId); const initResp = await initReceiveOrderPrice(settlementSeq, receiveBillId);
console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp)); console.log(' -> initReceiveOrderPrice:', JSON.stringify(initResp));
const waitSeconds = randomDelaySeconds();
console.log(' [延时] 随机等待 ' + waitSeconds + 's 后继续开票...');
await sleep(waitSeconds * 1000);
const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId); const confirmResp = await confirmInvoiceOrder(settlementSeq, receiveBillId);
console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp)); console.log(' -> confirmInvoiceOrder:', JSON.stringify(confirmResp));
@@ -341,15 +325,6 @@ async function processInternationalFlightBill(bill, billIndex, totalBills) {
console.log(''); console.log('');
} }
// ========== 15. 随机延时 ==========
function sleep(ms) {
return new Promise(function (resolve) { setTimeout(resolve, ms); });
}
function randomDelaySeconds() {
return Math.floor(15 + Math.random() * 31);
}
// ========== 接口错误检查 ========== // ========== 接口错误检查 ==========
function ensureOk(resp, what) { function ensureOk(resp, what) {
if (resp && resp.code && resp.code !== 'Z000') { if (resp && resp.code && resp.code !== 'Z000') {