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