Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Use rake task for syncing
Browse files Browse the repository at this point in the history
Otherwise, whenever writes each call separately and doesn't load the
environment.
  • Loading branch information
joegatt committed Sep 6, 2013
1 parent 75fcaad commit c6fa1ab
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
7 changes: 2 additions & 5 deletions config/schedule.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
set :output, "#{ Whenever.path }/log/sync.log"
set :output, "#{ path }/log/sync.log"

# REVIEW:
# require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
# require 'rubygems'
# every Settings.notes.synch_every_minutes.minutes do

every 1.minute do
runner 'EvernoteNote.sync_all'
runner 'Resource.sync_all_binaries'
runner 'Book.sync_all'
runner 'Link.sync_all'
rake 'RAILS_ENV=production sync:all'
end
18 changes: 9 additions & 9 deletions config/secret.sample.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
defaults: &defaults
database_encryption_key: CHANGEME_TO_AT_LEAST_30_RANDOM_ALPHANUMERIC_CHARACTERS_80_OR_SO_IS_BETTER
secret_key_base: CHANGEME_TO_AT_LEAST_30_RANDOM_ALPHANUMERIC_CHARACTERS_80_OR_SO_IS_BETTER
database_encryption_key: dshfkgsdahkfgsdhfgasdkjfh88*YXXXX8929jjkd--sadjajkYBT^R"%
secret_key_base: djhgiemvhimiryfcsjoweiqw98378ty9276vhshxbzkspqoewkfflregigjweiuweu923r72380190384957583785ytuhdgjhknvjsksklaskdqpwoeioqeriowetwirutieruti
mailer:
user_name: CHANGEME
password: CHANGEME
user_name: admin@joegatt.net
password: flAhhar09
auth:
evernote:
consumer_key: CHANGEME
consumer_secret: CHANGEME
consumer_key: joegatt-6398
consumer_secret: 1283f7bfdf033e9f
detect_language:
api_key: CHANGEME
api_key: 2252f8eaada2a0eb9d2bdce5e8cf234c
world_cat:
api_key: CHANGEME
api_key: wRXF1DxPbZ0PLsadbac5BmNSoZWI6MvB5Kx6jXfp2PGSB6DlJSRLzNB9GJkCjNOnLR4zuvjIgxnXmOAy
isbndb:
api_key: CHANGEME
api_key: 1A4S438C

development:
<<: *defaults
Expand Down
20 changes: 20 additions & 0 deletions lib/tasks/sync.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace :sync do

desc 'Asynchronous tasks'

task all: :environment do |t, args|
EvernoteNote.sync_all
sync_associated
end

task bulk: :environment do |t, args|
EvernoteNote.bulk_sync
sync_associated
end

def sync_associated
Resource.sync_all_binaries
Book.sync_all
Link.sync_all
end
end
17 changes: 0 additions & 17 deletions lib/tasks/sync_all_from_evernote.rake

This file was deleted.

0 comments on commit c6fa1ab

Please sign in to comment.