diff --git a/backend/config/schedule.rb b/backend/config/schedule.rb index 71de3c3..7ba2687 100644 --- a/backend/config/schedule.rb +++ b/backend/config/schedule.rb @@ -1,3 +1,5 @@ +env :PATH, '/root/.rbenv/shims:/root/.rbenv/bin:/usr/local/bin:/usr/bin:/bin' + set :output, standard: '/var/log/btrc_hub_nico_sync.log', error: '/var/log/btrc_hub_nico_sync_err.log' diff --git a/backend/lib/tasks/sync_nico.rake b/backend/lib/tasks/sync_nico.rake index d6e4f92..8fa3533 100644 --- a/backend/lib/tasks/sync_nico.rake +++ b/backend/lib/tasks/sync_nico.rake @@ -49,13 +49,13 @@ namespace :nico do end if post.tags.size < 20 name = 'タグ希望' - post.tags.destroy(post.tags.find_by(name:)) + post.tags.destroy(post.tags.find_by(name:) || []) post.tags << Tag.find_or_initialize_by(name:) { |tag| tag.category = 'meta' } end name = 'bot操作' - post.tags.destroy(post.tags.find_by(name:)) + post.tags.destroy(post.tags.find_by(name:) || []) post.tags << Tag.find_or_initialize_by(name:) { |tag| tag.category = 'meta' }