2023-05-06 08:24:25 +00:00
|
|
|
OrbitApp.cleanup_modules
|
|
|
|
begin
|
|
|
|
OrbitApp.check_module_permissions
|
|
|
|
rescue Exception => e
|
|
|
|
end
|
|
|
|
include BundlerHelper
|
|
|
|
|
|
|
|
site = Site.first
|
|
|
|
if (site.password_failed_lock_num.nil? rescue false)
|
|
|
|
site.update({:password_failed_lock_num=> site.fields['password_failed_lock_num'].options[:default]})
|
|
|
|
end
|
2024-02-24 06:54:42 +00:00
|
|
|
site.update(:valid_locales=>I18n.available_locales)
|
2023-05-06 08:24:25 +00:00
|
|
|
site.reset_cache
|
|
|
|
if ModuleApp.where(:key=>'member_sign_up').count > 1
|
|
|
|
ModuleApp.where(:key=>'member_sign_up')[0...1].each{|m| m.destroy}
|
|
|
|
end
|
|
|
|
|
|
|
|
if (site.page_sets.count==0 rescue false)
|
|
|
|
site.page_sets.create()
|
|
|
|
elsif site.page_sets.count > 1
|
|
|
|
site.page_sets.skip(1).destroy
|
|
|
|
end
|
2024-02-24 06:54:42 +00:00
|
|
|
begin
|
|
|
|
require File.expand_path('../do_on_startup_helper', __FILE__)
|
|
|
|
load_error = false
|
|
|
|
rescue LoadError
|
|
|
|
load_error = true
|
|
|
|
end
|
|
|
|
|
|
|
|
if File.basename($0) != 'rake' && !load_error
|
|
|
|
fix_email_job
|
|
|
|
fix_site_root_url(site)
|
2023-05-06 08:24:25 +00:00
|
|
|
if ShowForAdminMessage.first.nil?
|
|
|
|
ShowForAdminMessage.create()
|
|
|
|
end
|
|
|
|
|
|
|
|
if site.template.nil?
|
|
|
|
site.template = (Dir.glob("#{Rails.root}/app/templates/*").collect{|temp| temp.split('/').last}-['mobile']).first
|
|
|
|
site.save
|
|
|
|
end
|
2024-02-24 06:54:42 +00:00
|
|
|
require File.expand_path('../initial_site_data', __FILE__)
|
2023-05-06 08:24:25 +00:00
|
|
|
MemberProfileDefaultField.get_field_to_set
|
2024-02-24 06:54:42 +00:00
|
|
|
MemberIndexCache.all.delete_all
|
2023-05-06 08:24:25 +00:00
|
|
|
env_pwd = ENV['PWD']
|
|
|
|
dir_name = env_pwd.split('/')[-1]
|
2024-02-24 06:54:42 +00:00
|
|
|
fix_css_file
|
|
|
|
fix_template_header_file
|
|
|
|
fix_datatable_width_issue
|
2023-05-06 08:24:25 +00:00
|
|
|
|
2024-02-24 06:54:42 +00:00
|
|
|
watch_dog = %x[screen -ls auto_reopen_#{dir_name}]
|
2023-05-06 08:24:25 +00:00
|
|
|
if watch_dog.scan("auto_reopen_#{dir_name}").count != 0
|
|
|
|
bundler_with_clean_env{%x[screen -ls | grep auto_reopen_#{dir_name} | cut -d. -f1 | awk '{print $1}' | xargs kill]}
|
|
|
|
end
|
|
|
|
|
|
|
|
if !Rails.const_defined?('Console')
|
|
|
|
Thread.new do
|
|
|
|
begin
|
2024-02-24 06:54:42 +00:00
|
|
|
fix_script_permission
|
|
|
|
fix_page_part
|
|
|
|
fix_broken_page
|
2023-05-06 08:24:25 +00:00
|
|
|
# Site.make_cache
|
2024-02-24 06:54:42 +00:00
|
|
|
fix_empty_user
|
|
|
|
fix_old_content_unit(site)
|
|
|
|
fix_member_info_cache(site)
|
|
|
|
fix_db_index
|
|
|
|
fix_asset_data(site)
|
|
|
|
fix_user_password_notify(site)
|
|
|
|
fix_site_map(site)
|
|
|
|
fix_login_page(site)
|
|
|
|
fix_sort_number(site)
|
|
|
|
fix_thumb(site)
|
|
|
|
fix_selection_option(site)
|
|
|
|
fix_member_profile_field(site)
|
|
|
|
fix_member_page_cache(site)
|
|
|
|
fix_module_app(site)
|
|
|
|
fix_impression_count(site)
|
2023-09-05 14:54:01 +00:00
|
|
|
if ChecklistMainSetting.count == 0
|
|
|
|
ChecklistMainSetting.create
|
|
|
|
end
|
2023-05-06 08:24:25 +00:00
|
|
|
rescue => e
|
|
|
|
puts [e,e.backtrace]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|