Skip to content

Commit

Permalink
JdsServiceStartup | Removed caching from server config
Browse files Browse the repository at this point in the history
  • Loading branch information
Minyewoo committed Mar 30, 2024
1 parent 89ed64f commit 77e8127
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions lib/src/core/jds_service/jds_service_startup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,20 @@ class JdsServiceStartup {
await Future.delayed(_authRetryDelay);
_log.warning('Retrying...');
}
_log.info('Pulling points config...');
final configResult = await UpdateCacheFromJdsService(
cache: _cache,
jdsService: _service,
).apply();
switch(configResult) {
case Ok(value:final config):
_log.info('Requesting points config...');
switch(await _service.points()) {
case Ok(value:final configs):
_log.info('Points config successfully pulled!');
_log.info('Subscribing to received points...');
final subscribeResult = await _service.subscribe(
config.values.map((pointName) => pointName.toString()).toList(),
configs.names,
);
switch(subscribeResult) {
case Ok():
for(final name in config.keys) {
_dsClient.stream<String>(name);
}
_log.info('Succsessfully subscribed!');
return const Ok(null);
case Err(:final error):
_log.warning('Failed to subscribe');
return Err(error);
}
case Err(:final error):
Expand Down

0 comments on commit 77e8127

Please sign in to comment.