Skip to content

Commit e605c5a

Browse files
authored
enhance: increase request timeout for third party service (#418)
1 parent 9b34ec9 commit e605c5a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/modules/ThirdPartyService/index.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,11 @@ export default class ThirdPartyService extends RcModule {
524524
if (!this._contactSearchPath) {
525525
return [];
526526
}
527-
const { data } = await requestWithPostMessage(this._contactSearchPath, { searchString });
527+
const { data } = await requestWithPostMessage(
528+
this._contactSearchPath,
529+
{ searchString },
530+
30000
531+
);
528532
if (!Array.isArray(data)) {
529533
return [];
530534
}
@@ -541,7 +545,7 @@ export default class ThirdPartyService extends RcModule {
541545
if (!this._contactMatchPath) {
542546
return result;
543547
}
544-
const { data } = await requestWithPostMessage(this._contactMatchPath, { phoneNumbers }, 6000);
548+
const { data } = await requestWithPostMessage(this._contactMatchPath, { phoneNumbers }, 30000);
545549
if (!data || Object.keys(data).length === 0) {
546550
return result;
547551
}
@@ -565,7 +569,11 @@ export default class ThirdPartyService extends RcModule {
565569
if (!this._callLogEntityMatcherPath) {
566570
return result;
567571
}
568-
const { data } = await requestWithPostMessage(this._callLogEntityMatcherPath, { sessionIds });
572+
const { data } = await requestWithPostMessage(
573+
this._callLogEntityMatcherPath,
574+
{ sessionIds },
575+
30000)
576+
;
569577
if (!data || Object.keys(data).length === 0) {
570578
return result;
571579
}
@@ -590,7 +598,7 @@ export default class ThirdPartyService extends RcModule {
590598
return result;
591599
}
592600
const { data } = await requestWithPostMessage(
593-
this._messageLogEntityMatcherPath, { conversationLogIds }
601+
this._messageLogEntityMatcherPath, { conversationLogIds }, 30000
594602
);
595603
if (!data || Object.keys(data).length === 0) {
596604
return result;
@@ -678,7 +686,7 @@ export default class ThirdPartyService extends RcModule {
678686
};
679687
});
680688
}
681-
await requestWithPostMessage(this._meetingLoggerPath, { meeting: formatedMeeting });
689+
await requestWithPostMessage(this._meetingLoggerPath, { meeting: formatedMeeting }, 6000);
682690
} catch (e) {
683691
console.error(e);
684692
}
@@ -770,7 +778,7 @@ export default class ThirdPartyService extends RcModule {
770778
});
771779
item.messages = messages;
772780
}
773-
await requestWithPostMessage(this._messageLoggerPath, { conversation: item, ...options });
781+
await requestWithPostMessage(this._messageLoggerPath, { conversation: item, ...options }, 6000);
774782
if (this._messageLogEntityMatchSourceAdded) {
775783
this._conversationMatcher.match({
776784
queries: [item.conversationLogId],

0 commit comments

Comments
 (0)