みてるぞ 1 week ago
parent
commit
57f3cf83ae
2 changed files with 4 additions and 2 deletions
  1. +2
    -0
      backend/config/schedule.rb
  2. +2
    -2
      backend/lib/tasks/sync_nico.rake

+ 2
- 0
backend/config/schedule.rb View File

@@ -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', set :output, standard: '/var/log/btrc_hub_nico_sync.log',
error: '/var/log/btrc_hub_nico_sync_err.log' error: '/var/log/btrc_hub_nico_sync_err.log'




+ 2
- 2
backend/lib/tasks/sync_nico.rake View File

@@ -49,13 +49,13 @@ namespace :nico do
end end
if post.tags.size < 20 if post.tags.size < 20
name = 'タグ希望' 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| post.tags << Tag.find_or_initialize_by(name:) { |tag|
tag.category = 'meta' tag.category = 'meta'
} }
end end
name = 'bot操作' 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| post.tags << Tag.find_or_initialize_by(name:) { |tag|
tag.category = 'meta' tag.category = 'meta'
} }


Loading…
Cancel
Save