day_planner 0.1.0.pre5.1 → 0.1.0.pre6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/PLANS.md +25 -0
- data/lib/day_planner/engine.rb +8 -6
- data/lib/day_planner/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d544914bc41dc8680a5dcbdb16e25d057db5f7c
|
4
|
+
data.tar.gz: e44d7fbc3890aa8b653c7c364ad971f9a6169efa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 164909dfe43a45024a76685cbb1788abdd92bebd4dbc3a96c861dd5604a4f03d445794d45b8cbb940e96d8f03d221356c77fb224c51619441ad220f95815f567
|
7
|
+
data.tar.gz: a94ef5790e6d5c9a702e91d0f4d9dec105067e3325118f4f11ebee918bb5a857259019df288c8f9fc8d29eada95849f18e1b65c3b5238bbf5c22483fba87cc77
|
data/PLANS.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
## For future releases ##
|
2
|
+
|
3
|
+
### Track tasks across application launch instances ###
|
4
|
+
This is basically a gimme as long as we're already recording stuff in a database:
|
5
|
+
* Delete only anonymous tasks on initialize, don't delete anything with a persistent name and interval
|
6
|
+
** But do delete any task with an unfamiliar name or name, interval combo
|
7
|
+
* Don't worry about task content changing. Fine, change it. We don't store that in a database anyway.
|
8
|
+
* Don't reinitialize persistent events, just keep them on schedule. This helps especially if e.g. dealing with a pricy API -- why pull more often than needed?
|
9
|
+
|
10
|
+
### Log each tasks's history ###
|
11
|
+
HIGH PRIORITY: I want to be able to monitor the elaborate new scheduling algorithm appropriately. This needs to be optional, but it would be nice to have the ability to monitor at least how well the task adheres to the timeline.
|
12
|
+
|
13
|
+
### Attempt some degree of control with multi-process instances ###
|
14
|
+
Not sure exactly how to do this.
|
15
|
+
* Store a record of the scheduler's execution status in a database? Then use that to avoid it being unnecessarily run in multiple threads?
|
16
|
+
* Hell, even an optional "view scheduler status" page in the app. Why not?
|
17
|
+
|
18
|
+
### Some degree of DB independence ###
|
19
|
+
This needs to wait until we have the multi-process thing down.
|
20
|
+
* Set a separate interval for updating the DB, and in between just use in-memory stuff?
|
21
|
+
** This probably would need to be done on some sort of basis of strict multiples, i.e. every 6th tick, update the database. Make sure that we can be okay with circumstances in which the DB is not up to date. (Tasks might resume unnecessarily soon, etc., but shit, do I care?)
|
22
|
+
* The value of this is when the interval is quite low, at which point both the DB usage and the time that the queries take starts dominating the scene
|
23
|
+
|
24
|
+
### Other task scheduling techniques ###
|
25
|
+
Something cronesque, but not so annoying. Maybe options like hourly, daily, weekly, accompanied (optionally) by at, or on. These would need different logic from our "every", try-to-stay-on-task style items.
|
data/lib/day_planner/engine.rb
CHANGED
@@ -5,12 +5,14 @@ module DayPlanner
|
|
5
5
|
class Railtie < Rails::Engine
|
6
6
|
isolate_namespace DayPlanner
|
7
7
|
|
8
|
-
unless $0 =~ /rake/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
unless $0 =~ /rake/ !defined?(Rails.env) || !Rails.env.production?
|
9
|
+
unless defined?(::Rails::Console) || ENV['EXECUTE_SCHEDULED_TASKS_IN_CONSOLE']
|
10
|
+
initializer "day_planner.activate", after: :finisher_hook do
|
11
|
+
puts "DayPlanner starting up"
|
12
|
+
DayPlanner.clear_tasks
|
13
|
+
require Rails.root.join('config', 'scheduled_tasks')
|
14
|
+
DayPlanner.activate
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
data/lib/day_planner/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: day_planner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.pre6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damon Siefert
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- Gemfile
|
78
78
|
- LICENSE
|
79
79
|
- LICENSE.txt
|
80
|
+
- PLANS.md
|
80
81
|
- README.md
|
81
82
|
- Rakefile
|
82
83
|
- app/models/day_planner/task.rb
|