feat(ncm): unikey 失败自动 5s 退避重试(不再要求用户点重试)
This commit is contained in:
1 parent
4199dc77ea
commit
796d022c77
2 files changed
+8
-1
No files matched your search
@@ -96,7 +96,14 @@ static void *login_worker(void *arg)
|
|||||||
{
|
{
|
||||||
(void)arg;
|
(void)arg;
|
||||||
char unikey[64];
|
char unikey[64];
|
||||||
if (get_unikey_and_qr(unikey, sizeof unikey) != NCM_OK) { g_err = 1; return NULL; }
|
/* 自动重试:unikey 失败(网络未就绪/抖动)时 5s 退避重试,不再要求用户点重试 */
|
||||||
|
int retry = 0;
|
||||||
|
while (get_unikey_and_qr(unikey, sizeof unikey) != NCM_OK) {
|
||||||
|
g_err = 1;
|
||||||
|
if (g_app_quit) return NULL;
|
||||||
|
meow_log(MEOW_LOG_WARN, "login: unikey retry in 5s (attempt %d)", ++retry);
|
||||||
|
usleep(5 * 1000 * 1000);
|
||||||
|
}
|
||||||
meow_log(MEOW_LOG_INFO, "login: poll worker start");
|
meow_log(MEOW_LOG_INFO, "login: poll worker start");
|
||||||
|
|
||||||
char cookie[NCM_COOKIE_MAX];
|
char cookie[NCM_COOKIE_MAX];
|
||||||
|
|||||||
Binary file not shown.
Reference in new issue
Block a user