refactor: call getLatestExecution in sync and add an arg to getLatestExecution to skip syncing
This commit is contained in:
parent
f68688ab61
commit
e567d5017d
|
@ -72,6 +72,7 @@ export default abstract class BaseClient {
|
|||
await init("herumi");
|
||||
|
||||
await this._sync();
|
||||
await this.getLatestExecution(false);
|
||||
}
|
||||
|
||||
public getCurrentPeriod(): number {
|
||||
|
@ -187,8 +188,10 @@ export default abstract class BaseClient {
|
|||
}
|
||||
}
|
||||
|
||||
async getLatestExecution(): Promise<ExecutionInfo | null> {
|
||||
await this._sync();
|
||||
async getLatestExecution(sync = true): Promise<ExecutionInfo | null> {
|
||||
if (sync) {
|
||||
await this._sync();
|
||||
}
|
||||
|
||||
const getExecInfo = (u: OptimisticUpdate) => {
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue