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 init("herumi");
|
||||||
|
|
||||||
await this._sync();
|
await this._sync();
|
||||||
|
await this.getLatestExecution(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCurrentPeriod(): number {
|
public getCurrentPeriod(): number {
|
||||||
|
@ -187,8 +188,10 @@ export default abstract class BaseClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getLatestExecution(): Promise<ExecutionInfo | null> {
|
async getLatestExecution(sync = true): Promise<ExecutionInfo | null> {
|
||||||
await this._sync();
|
if (sync) {
|
||||||
|
await this._sync();
|
||||||
|
}
|
||||||
|
|
||||||
const getExecInfo = (u: OptimisticUpdate) => {
|
const getExecInfo = (u: OptimisticUpdate) => {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue