mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: change default timeout
This commit is contained in:
parent
23b16a7f85
commit
ca83acb3c7
3 changed files with 9 additions and 7 deletions
|
|
@ -10,7 +10,7 @@ export async function getOpenAIAuth (opt) {
|
|||
password,
|
||||
browser,
|
||||
page,
|
||||
timeoutMs = 2 * 60 * 1000,
|
||||
timeoutMs = Config.chromeTimeoutMS,
|
||||
isGoogleLogin = false,
|
||||
captchaToken = Config['2captchaToken'],
|
||||
executablePath = Config.chromePath
|
||||
|
|
@ -48,7 +48,7 @@ export async function getOpenAIAuth (opt) {
|
|||
while (retry > 0) {
|
||||
try {
|
||||
await waitForConditionOrAtCapacity(page, () =>
|
||||
page.waitForSelector('#__next .btn-primary', { timeout: 2000 })
|
||||
page.waitForSelector('#__next .btn-primary', { timeout: timeoutMs / 3 })
|
||||
)
|
||||
} catch (e) {
|
||||
await checkForChatGPTAtCapacity(page)
|
||||
|
|
@ -56,7 +56,7 @@ export async function getOpenAIAuth (opt) {
|
|||
retry--
|
||||
}
|
||||
await waitForConditionOrAtCapacity(page, () =>
|
||||
page.waitForSelector('#__next .btn-primary', { timeout: 2000 })
|
||||
page.waitForSelector('#__next .btn-primary', { timeout: timeoutMs / 3 })
|
||||
)
|
||||
await delay(500)
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ export async function getOpenAIAuth (opt) {
|
|||
|
||||
async function checkForChatGPTAtCapacity (page, opts = {}) {
|
||||
const {
|
||||
timeoutMs = 2 * 60 * 1000, // 2 minutes
|
||||
timeoutMs = Config.chromeTimeoutMS, // 2 minutes
|
||||
pollingIntervalMs = 3000,
|
||||
retries = 10
|
||||
} = opts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue