From 53c6fc53795b2baeceeb76bc0d2090461f3d319c Mon Sep 17 00:00:00 2001 From: Ryan Melton Date: Mon, 16 Dec 2024 15:48:31 -0700 Subject: [PATCH 1/2] Fix sharding --- openc3/lib/openc3/operators/microservice_operator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/openc3/lib/openc3/operators/microservice_operator.rb b/openc3/lib/openc3/operators/microservice_operator.rb index 6e0d5788d..41e0bdf61 100644 --- a/openc3/lib/openc3/operators/microservice_operator.rb +++ b/openc3/lib/openc3/operators/microservice_operator.rb @@ -43,6 +43,7 @@ def initialize @changed_microservices = {} @removed_microservices = {} @shard = ENV['OPENC3_SHARD'] || 0 + @shard = @shard.to_i end def convert_microservice_to_process_definition(microservice_name, microservice_config) From 4fe70f0f8e8115d355548c8d8dfd0857394a89d2 Mon Sep 17 00:00:00 2001 From: Ryan Melton Date: Mon, 16 Dec 2024 16:45:37 -0700 Subject: [PATCH 2/2] fix calendar.py to work at any day/time --- .../openc3-cosmos-demo/targets/INST2/procedures/calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST2/procedures/calendar.py b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST2/procedures/calendar.py index 355036ba1..f0c6fa735 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST2/procedures/calendar.py +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST2/procedures/calendar.py @@ -21,7 +21,7 @@ ) # => {"name":"Mine", "color":"#4287f5", "scope":"DEFAULT", "updated_at":1698763720728596964} now = datetime.now(timezone.utc) -start = datetime(now.year, now.month, now.day, now.hour + 1, 30, 00, 00, timezone.utc) +start = now + timedelta(hours=1) stop = start + timedelta(hours=1) # Stop plus 1hr act = create_timeline_activity("Mine", kind="reserve", start=start, stop=stop) print(act) # =>