Skip to content

Commit dc035b3

Browse files
authored
Merge pull request #2785 from ndrsnhs/fix-secondary-update-order
change secondary update order
2 parents 1987d68 + 51ea8ee commit dc035b3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

packages/helpermodules/command.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,16 @@ def systemUpdate(self, connection_id: str, payload: dict) -> None:
819819
Pub().pub("openWB/system/update_in_progress", False)
820820
return
821821
parent_file = Path(__file__).resolve().parents[2]
822+
if not SubData.general_data.data.extern and SubData.system_data["system"].data["secondary_auto_update"]:
823+
for cp in SubData.cp_data.values():
824+
# if chargepoint is external_openwb and not the second CP of duo and version is Release
825+
if all(
826+
cp.chargepoint.chargepoint_module.config.type == 'external_openwb',
827+
cp.chargepoint.chargepoint_module.config.configuration.duo_num == 0,
828+
cp.chargepoint.data.get.current_branch == "Release"
829+
):
830+
time.sleep(2)
831+
self.secondaryChargepointUpdate({"data": {"chargepoint": f"cp{cp.chargepoint.num}"}})
822832
if "branch" in payload["data"] and "tag" in payload["data"]:
823833
pub_user_message(
824834
payload, connection_id,
@@ -833,16 +843,6 @@ def systemUpdate(self, connection_id: str, payload: dict) -> None:
833843
run_command([
834844
str(parent_file / "runs" / "update_self.sh"),
835845
SubData.system_data["system"].data["current_branch"]])
836-
if not SubData.general_data.data.extern and SubData.system_data["system"].data["secondary_auto_update"]:
837-
for cp in SubData.cp_data.values():
838-
# if chargepoint is external_openwb and not the second CP of duo and version is Release
839-
if (
840-
cp.chargepoint.chargepoint_module.config.type == 'external_openwb' and
841-
cp.chargepoint.chargepoint_module.config.configuration.duo_num == 0 and
842-
cp.chargepoint.data.get.current_branch == "Release"
843-
):
844-
time.sleep(2)
845-
self.secondaryChargepointUpdate({"data": {"chargepoint": f"cp{cp.chargepoint.num}"}})
846846

847847
def systemFetchVersions(self, connection_id: str, payload: dict) -> None:
848848
log.info("Fetch versions requested")

0 commit comments

Comments
 (0)