Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrandolph committed Nov 4, 2022
1 parent 43d12ac commit 495eb06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions pubber/src/main/java/daq/pubber/Pubber.java
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ private void maybeRestartSystem() {
if (systemConfig == null) {
return;
}
info("maybeRestartSystem " + deviceState.system.mode + " " + systemConfig.mode);
if (SystemMode.ACTIVE.equals(deviceState.system.mode)
&& SystemMode.RESTART.equals(systemConfig.mode)) {
restartSystem(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,19 @@ public void endpoint_config_connection_success_reset() {
info("============== last_start > 0");
}

deviceConfig.system.mode = SystemMode.ACTIVE;
updateConfig();

untilTrue("deviceState.system.mode == ACTIVE", () -> {
return deviceState.system.mode.equals(SystemMode.ACTIVE); } );

final Date last_config = deviceState.system.last_config;
final Date last_start = deviceConfig.system.last_start;

deviceConfig.system.mode = SystemMode.RESTART;
updateConfig();


info("================1 previous last_config = " + last_config);
info("================1 current last_config = " + deviceState.system.last_config);

Expand Down Expand Up @@ -184,11 +191,15 @@ public void endpoint_config_connection_success_redirect() {
deviceConfig.blobset = new BlobsetConfig();
deviceConfig.blobset.blobs = new HashMap<>();
deviceConfig.blobset.blobs.put(SystemBlobsets.IOT_ENDPOINT_CONFIG.value(), config);
updateConfig();

untilTrue("blobset entry config status is success", () -> {
BlobPhase phase = deviceState.blobset.blobs.get(
SystemBlobsets.IOT_ENDPOINT_CONFIG.value()).phase;
Entry stateStatus = deviceState.system.status;
if (phase != null) {
info("phase = " + phase);
}
return phase != null
&& phase.equals(BlobPhase.FINAL)
&& stateStatus.category.equals(SYSTEM_CONFIG_APPLY)
Expand Down

0 comments on commit 495eb06

Please sign in to comment.