Exponential retry login
This commit is contained in:
parent
62feade251
commit
867f8e15db
@ -5,6 +5,7 @@ import {
|
||||
KILL_SIGNALS,
|
||||
REFRESH_JWT_MS,
|
||||
} from "./constants.js";
|
||||
import { with_exponential_retry } from "./exponential_retry.js";
|
||||
import * as actions from "./actions.js";
|
||||
import * as session from "./session.js";
|
||||
import * as argparse from "argparse";
|
||||
@ -86,7 +87,9 @@ specify another socket path with --socket_path`
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await session.login(process.env.A_NUMBER, process.env.PASSWORD);
|
||||
await with_exponential_retry(() =>
|
||||
session.login(process.env.A_NUMBER, process.env.PASSWORD)
|
||||
);
|
||||
session.refresh_jwt();
|
||||
setInterval(session.refresh_jwt, REFRESH_JWT_MS);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user