oto/apps/runner/lib/cli/commands/scheduler/scheduler_interval.dart
toki 86afabb3eb refactor(runner): 런타임 패키지를 앱 하위로 이동한다
독립 control plane 구성을 위해 기존 Dart CLI/runtime을 runner 앱 경계로 옮기고, 후속 client/core/root 작업을 같은 마일스톤 task group에 연결한다.
2026-06-05 06:34:45 +09:00

32 lines
No EOL
613 B
Dart

import 'package:oto/oto/data/command_data.dart';
class SchedulerInterval {
int interval;
bool activate = true;
bool progress = false;
DataBuild build;
Future Function(DataBuild build) executeFunc;
SchedulerInterval(this.interval, this.build, this.executeFunc) {
startInterval();
}
void startInterval() async {
while(activate) {
await Future.delayed(Duration(milliseconds: interval));
if(!progress) {
execute();
}
}
}
void execute() async {
if(activate) {
progress = true;
await executeFunc(build);
progress = false;
}
}
}