initialize static method

Future<void> initialize()

Implementation

static Future<void> initialize() async {
  final Map<String, dynamic>? json = await Store.get('Scheduler');

  if (json != null) {
    for (final log in json['logs']) {
      logs.add(_ScheduledActionLog.fromJson(log));
    }
  }

  Log.info('[Scheduler] Initialized heartbeat.');
  Timer.periodic(const Duration(seconds: 5), (_) {
    receiveHeartbeat();
  });
}