mirror of
https://github.com/thewesker/ebooks_example.git
synced 2025-12-22 05:11:08 -05:00
Add Boodoo::CloudModel and Boodoo::CloudArchive
Inheriting from Ebooks::Model/Archive, these have mthods for dealing with fetching/persisting via Heroku's Cloudinary plugin.
This commit is contained in:
14
bots.rb
14
bots.rb
@@ -65,9 +65,12 @@ class BoodooBot
|
||||
@archive_path = "corpus/#{@original}.json"
|
||||
@model_path = "model/#{@original}.model"
|
||||
|
||||
log "WARNING: Cloudinary is not configured. Will not persist to cloud." unless has_cloud?
|
||||
|
||||
if can_run?
|
||||
update_archive!
|
||||
make_model!
|
||||
log "This can run!"
|
||||
@archive = CloudArchive.new(original, archive_path, twitter)
|
||||
@model = CloudModel.consume(@archive_path)
|
||||
else
|
||||
missing_fields.each {|missing|
|
||||
log "Can't run without #{missing}"
|
||||
@@ -103,8 +106,11 @@ class BoodooBot
|
||||
|
||||
scheduler.interval @refresh_model_interval do
|
||||
log "Refreshing archive/model..."
|
||||
update_archive!
|
||||
make_model!
|
||||
# update_archive!
|
||||
# make_model!
|
||||
@archive.sync
|
||||
@archive.persist
|
||||
@model.consume(@archive)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user