Skip to content

Commit b9597c0

Browse files
authored
Merge pull request #2139 from stephen-ritter/hotfix/tlm-cmd-count-reset
Reset the Tlm and Cmd Counts on Undeploy
2 parents 16fb953 + 90f2e42 commit b9597c0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

openc3/lib/openc3/models/target_model.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,8 @@ def undeploy
676676
LimitsEventTopic.delete(@name, scope: @scope)
677677
Store.del("#{@scope}__openc3tlm__#{@name}")
678678
Store.del("#{@scope}__openc3cmd__#{@name}")
679+
Store.del("#{@scope}__TELEMETRYCNTS__{#{@name}}")
680+
Store.del("#{@scope}__COMMANDCNTS__{#{@name}}")
679681

680682
# Note: these match the names of the services in deploy_microservices
681683
%w(MULTI DECOM COMMANDLOG DECOMCMDLOG PACKETLOG DECOMLOG REDUCER CLEANUP).each do |type|
@@ -795,6 +797,7 @@ def update_store_telemetry(packet_hash, clear_old: true)
795797
if clear_old
796798
Store.del("#{@scope}__openc3tlm__#{target_name}")
797799
Store.del("#{@scope}__openc3tlm__#{target_name}__allitems")
800+
Store.del("#{@scope}__TELEMETRYCNTS__{#{target_name}}")
798801
end
799802
packets.each do |packet_name, packet|
800803
Logger.debug "Configuring tlm packet: #{target_name} #{packet_name}"
@@ -816,7 +819,10 @@ def update_store_telemetry(packet_hash, clear_old: true)
816819

817820
def update_store_commands(packet_hash, clear_old: true)
818821
packet_hash.each do |target_name, packets|
819-
Store.del("#{@scope}__openc3cmd__#{target_name}") if clear_old
822+
if clear_old
823+
Store.del("#{@scope}__openc3cmd__#{target_name}")
824+
Store.del("#{@scope}__COMMANDCNTS__{#{target_name}}")
825+
end
820826
packets.each do |packet_name, packet|
821827
Logger.debug "Configuring cmd packet: #{target_name} #{packet_name}"
822828
begin

openc3/python/openc3/models/target_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ def update_store_telemetry(self, packet_hash, clear_old=True):
392392
if clear_old:
393393
Store.delete(f"{self.scope}__openc3tlm__{target_name}")
394394
Store.delete(f"{self.scope}__openc3tlm__{target_name}__allitems")
395+
Store.delete(f"{self.scope}__TELEMETRYCNTS__{{{target_name}}}")
395396
for packet_name, packet in packets.items():
396397
Logger.debug(f"Configuring tlm packet= {target_name} {packet_name}")
397398
try:
@@ -414,6 +415,7 @@ def update_store_commands(self, packet_hash, clear_old=True):
414415
for target_name, packets in packet_hash.items():
415416
if clear_old:
416417
Store.delete(f"{self.scope}__openc3cmd__{target_name}")
418+
Store.delete(f"{self.scope}__COMMANDCNTS__{{{target_name}}}")
417419
for packet_name, packet in packets.items():
418420
Logger.debug(f"Configuring cmd packet= {target_name} {packet_name}")
419421
try:

0 commit comments

Comments
 (0)