Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task persistence and a reorganized task manager #40

Merged
merged 16 commits into from
Jan 24, 2024

Conversation

jeff-cohere
Copy link
Collaborator

The main purposes of this PR is to teach the DTS how to save and restore tasks when it is stopped and restarted. This objective, combined with the goal of keeping it relatively easy to add new database/endpoint implementations (and test fixtures for both) required me to rethink how things are organized a bit. The biggest changes are:

  • The task manager has been pulled out of the core package and given its own tasks package
  • The task manager is now a singleton, and there's no longer an accessible object instance for it, because the singleton pattern done the OO way is a rat's nest! Instead, there are functions namespaced by the tasks package for doing the needful.
  • The task manager now leverages information in the config file, since it's no longer considered to be a "core" thing. This makes it easier to get data about the system as a whole.
  • Logic has been cleaned up and reworked as needed in the databases and endpoints packages.

Additionally, I've reworked the example configuration file.

Closes #34
Closes #35

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 167 lines in your changes are missing coverage. Please review.

Comparison is base (63f6cdb) 61.95% compared to head (1e10656) 61.43%.

Files Patch % Lines
tasks/tasks.go 64.39% 101 Missing and 40 partials ⚠️
config/config.go 20.00% 6 Missing and 2 partials ⚠️
endpoints/endpoints.go 74.19% 6 Missing and 2 partials ⚠️
services/prototype.go 38.46% 8 Missing ⚠️
databases/databases.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
- Coverage   61.95%   61.43%   -0.52%     
==========================================
  Files          13       12       -1     
  Lines        1732     1893     +161     
==========================================
+ Hits         1073     1163      +90     
- Misses        527      578      +51     
- Partials      132      152      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tasks/tasks.go Outdated Show resolved Hide resolved
tasks/tasks_test.go Outdated Show resolved Hide resolved
tasks/tasks_test.go Outdated Show resolved Hide resolved
This was referenced Jan 23, 2024
@jeff-cohere jeff-cohere merged commit 8d7c272 into main Jan 24, 2024
2 checks passed
@jeff-cohere jeff-cohere deleted the jeff-cohere/persistent-store branch January 24, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix cleanup enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement persistent store for requested and completed transfers Update the example YAML config file
2 participants