Skip to content

Commit

Permalink
removed old stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Mar 25, 2024
1 parent f9ff131 commit ad5700e
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions skyscan-c2/c2_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def __init__(
self: Any,
hostname: str,
config_topic: str,
c2_topic: str,
ledger_topic: str,
object_topic: str,
prioritized_ledger_topic: str,
Expand Down Expand Up @@ -72,7 +71,6 @@ def __init__(
# initialize attributes
self.hostname = hostname
self.config_topic = config_topic
self.c2_topic = c2_topic
self.ledger_topic = ledger_topic
self.object_topic = object_topic
self.prioritized_ledger_topic = prioritized_ledger_topic
Expand Down Expand Up @@ -156,7 +154,6 @@ def __init__(
f"""C2PubSub initialized with parameters:
hostname = {hostname}
config_topic = {config_topic}
c2_topic = {c2_topic}
ledger_topic = {ledger_topic}
object_topic = {object_topic}
prioritized_ledger_topic = {prioritized_ledger_topic}
Expand Down Expand Up @@ -571,13 +568,7 @@ def main(self: Any) -> None:
# publish heartbeat to keep the TCP/IP connection alive
schedule.every(10).seconds.do(self.publish_heartbeat, payload="C2 Heartbeat")

# every file interval, publish a message to broadcast to file
# saving nodes to change files
schedule.every(self.file_interval).minutes.do(
self.publish_to_topic,
topic_name=self.c2_topic,
publish_payload=json.dumps({"msg": "NEW FILE"}),
)

self.add_subscribe_topic(self.config_topic, self._config_callback)
self.add_subscribe_topic(self.ledger_topic, self._target_selection_callback)
self.add_subscribe_topic(
Expand All @@ -600,7 +591,6 @@ def main(self: Any) -> None:
hostname=str(os.environ.get("HOSTNAME")),
mqtt_ip=str(os.environ.get("MQTT_IP")),
config_topic=os.environ.get("CONFIG_TOPIC", ""),
c2_topic=str(os.environ.get("C2_TOPIC")),
ledger_topic=str(os.environ.get("LEDGER_TOPIC")),
object_topic=str(os.environ.get("OBJECT_TOPIC")),
prioritized_ledger_topic=str(os.environ.get("PRIORITIZED_LEDGER_TOPIC")),
Expand Down

0 comments on commit ad5700e

Please sign in to comment.