Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.

Huey schdule fixes and test uniformization - #24

Merged
GuillaumeDSM merged 6 commits into
masterfrom
demo
Jan 13, 2026
Merged

GuillaumeDSM merged 6 commits into
masterfrom
demo

Conversation

@GuillaumeDSM

Copy link
Copy Markdown
Member

No description provided.

@GuillaumeDSM GuillaumeDSM self-assigned this Jan 13, 2026

@Herklos Herklos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

assert task_result == expected_result
if encrypted_result:
assert isinstance(json.loads(result[octobot_node.app.enums.TaskResultKeys.METADATA.value]), dict)
assert result[octobot_node.app.enums.TaskResultKeys.METADATA.value]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tests!

Comment on lines +71 to +80
next_execution_time = next_actions_description.get_next_execution_time()
now_time = time.time()
if next_execution_time == 0 or next_execution_time < now_time:
delay = 0
else:
next_execution_time = datetime.datetime.fromtimestamp(
next_actions_description.get_next_execution_time(),
tz=datetime.timezone.utc
)
execute_octobot.schedule(args=[task], eta=next_execution_time)
delay = next_execution_time - now_time
logging.getLogger("octobot_node.scheduler.tasks").info(
f"Scheduling task '{task.name}' for execution in {delay} seconds"
)
return execute_octobot.schedule(args=[task], delay=delay)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread octobot_node/scheduler/scheduler.py Outdated
Comment on lines +55 to +58
elif settings.USE_MEMORY_SCHEDULER:
# warning: this mode has no persistence, tasks will be lost when the process is stopped
self.logger.info("Initializing scheduler with memory backend")
self.INSTANCE = MemoryHuey(DEFAULT_NAME)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could use something like an init arg or class global variable to set this value if users shouldn't use it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's now disabled, we now use sqlitehuey in tests

@Herklos Herklos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@GuillaumeDSM
GuillaumeDSM merged commit 31ac941 into master Jan 13, 2026
5 checks passed
@GuillaumeDSM
GuillaumeDSM deleted the demo branch January 13, 2026 18:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants