Skip to content

Commit

Permalink
尝试满足eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvigarabis committed Aug 23, 2023
1 parent 7eea6f3 commit 8c35391
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/yoni/Location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,9 @@ function requireEntityObject(argc: 1, args: any[]){
if (!rotation && "function" === typeof entity.getRotation){
try {
rotation = entity.getRotation();
} catch {}
} catch {
//no thing to do
}
}

return location && rotation && dimension
Expand Down
7 changes: 4 additions & 3 deletions src/yoni/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class Schedule {
constructor(props: ScheduleOptions, callback: () => void){
let { async, period, delay, type } = props;

this.async = (!!async) ? true : false;
this.async = (!!async);

if (isCycleScheduleType(type)
&& !isFinite(period as number))
Expand Down Expand Up @@ -260,6 +260,9 @@ function executeSchedule(schedule: Schedule){
executingSchedule = null;
}
if (schedule.async) {
runningAsyncSchedule.add(schedule);
schedule.runAsync().then(onSuccess, onFail);

function onSuccess(result: any){
lastSuccess(schedule, Date.now());
runningAsyncSchedule.delete(schedule);
Expand All @@ -269,8 +272,6 @@ function executeSchedule(schedule: Schedule){
runningAsyncSchedule.delete(schedule);
logger.error("async schedule {} 运行时出现错误 {}", schedule.id, error);
}
runningAsyncSchedule.add(schedule);
schedule.runAsync().then(onSuccess, onFail);
} else {
executingSchedule = schedule;

Expand Down

0 comments on commit 8c35391

Please sign in to comment.