Skip to content

Commit dde0efb

Browse files
committed
Fix outdated code comments
1 parent 8f07f2d commit dde0efb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

goosebit/updater/controller/v1/routes.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,33 +125,30 @@ async def deployment_feedback(
125125
await updater.deployment_action_success()
126126
await updater.update_device_state(UpdateStateEnum.FINISHED)
127127

128-
# not guaranteed to be the correct rollout - see next comment.
129128
rollout = await updater.get_rollout()
130129
if rollout:
131130
if rollout.software == reported_software:
132131
rollout.success_count += 1
133132
await rollout.save()
134133
else:
134+
# edge case where device update mode got changed while update was running
135135
logging.warning(
136136
f"Updating rollout success stats failed, software={reported_software.id}, device={updater.dev_id}" # noqa: E501
137137
)
138138

139-
# setting the currently installed version based on the current assigned software / existing rollouts
140-
# is problematic. Better to assign custom action_id for each update (rollout id? software id? new id?).
141-
# Alternatively - but requires customization on the gateway side - use version reported by the gateway.
142139
await updater.update_sw_version(reported_software.version)
143140
logger.debug(f"Installation successful, software={reported_software.version}, device={updater.dev_id}")
144141

145142
elif data.status.result.finished == FeedbackStatusResultFinished.FAILURE:
146143
await updater.update_device_state(UpdateStateEnum.ERROR)
147144

148-
# not guaranteed to be the correct rollout - see comment above.
149145
rollout = await updater.get_rollout()
150146
if rollout:
151147
if rollout.software == reported_software:
152148
rollout.failure_count += 1
153149
await rollout.save()
154150
else:
151+
# edge case where device update mode got changed while update was running
155152
logging.warning(
156153
f"Updating rollout failure stats failed, software={reported_software.id}, device={updater.dev_id}" # noqa: E501
157154
)

0 commit comments

Comments
 (0)