-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement cache and TaskGroup #23
base: master
Are you sure you want to change the base?
Conversation
a81a4e7
to
ade1e7b
Compare
@squiggleuk : would you mind to test this PR to see if it solves your issue please? $ git clone -b cache-task-group https://github.com/chtitux/dovico.git
$ cd dovico/
$ bundle exec bin/dovico --tasks
$ dovico --show --start 2019-10-01 --end 2019-10-07 Or just I have implemented a local cache so the first run will be long, but next ones should be quicker. Thank you for testing! |
ade1e7b
to
dce51f7
Compare
I get errors with this PR... AssignmentID C210 unsupported
|
dce51f7
to
bcc4aab
Compare
At least, we have a new kind of error 😅 The "Client" assigment was not included but it seems it's used in your Dovico setup. Could you |
We're making progress! Good output from Example:
Also I can now fill and submit time records!!! Thanks :D |
bcc4aab
to
b1dd9ac
Compare
- Implement a cache so we don't have to fetch all tasks on every call - Browse Assigments recursively so we handle TaskGroup (and any other forms of tree if it's ever allowed by Dovico) - Improve formatter so we have a nicer display per day
b1dd9ac
to
f27e4d2
Compare
|
||
attr_reader :assignments, :myself | ||
|
||
CACHE_FILE = "#{APP_DIRECTORY}/assignments.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File.join(APP_DIRECTORY, 'assgnments.json')
will be more portable I think
|
||
@assignments = Assignment.unserialize(json["assignments"]) unless json["assignments"].nil? | ||
@myself = Employee.unserialize(json["myself"]) unless json["myself"].nil? | ||
rescue JSON::ParserError, CacheError => e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 wdyt of logging something to stderr on CacheError exceptions?
@@ -0,0 +1,4 @@ | |||
module Dovico | |||
class TaskGroup < Assignment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May it make sense to group various assignment types in Dovico::Assignment::
?
Like Dovico::Assignment::TaskGroup
, Dovico::Assignment::Task
?
module Dovico
class Client < Assignment
is a bit confusing, I'm thinking rather of an API client then of an assignment
It's a big refactoring on how we manage entries but I hope it'll be easier if there are multiple levels of folders.