This commit is contained in:
chiu committed 2024-01-25 08:25:31 +08:00
1 parent 00897951b1
commit 7f3bbe7948
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -941,7 +941,7 @@ module FguSyncPlugin
end
end
namespace :sync_nccu_personal_plugins do
namespace :sync_fgu_personal_plugins do
task :sync,[:uid] => :environment do |task,args|
#require "#{ENV['PWD']}/app/models/member_profile" #it will cause circular dependency
FguSyncPlugin.init
+2 -2
View File
@@ -34,8 +34,8 @@ if bundle_update_flag
puts "Installing tiny_tds gem ..."
bundler_with_clean_env{ system("gem install tiny_tds -- '--with-freetds-dir=#{home_path}/freetds-1.1.24_build'") }
end
crontab_sync = `crontab -l|grep 'bundle exec rake sync_nccu_personal_plugins:sync'|grep #{ENV['PWD']}`
sync_cron="0 0 * * * /bin/bash -l -c 'cd #{ENV['PWD']} && bundle exec rake sync_nccu_personal_plugins:sync > /dev/null'"
crontab_sync = `crontab -l|grep 'bundle exec rake sync_fgu_personal_plugins:sync'|grep #{ENV['PWD']}`
sync_cron="0 0 * * * /bin/bash -l -c 'cd #{ENV['PWD']} && bundle exec rake sync_fgu_personal_plugins:sync > /dev/null'"
crontab_sync_jobs = crontab_sync.split("\n")
if crontab_sync_jobs.count == 0
%x(CRON="#{sync_cron}" && (crontab -l; echo "$CRON" ) | crontab -)