Commit e4384966 by liangyuzhe

Merge branch 'master' into release

parents 6264a6e1 cb8dd3b0
......@@ -83,7 +83,7 @@ class PushsController < ApplicationController
params[:sync_push] ||= false
push_sync(params[:sync_push], {device_ids_opts: device_ids_opts, message: message, app_type: params[:app_type], igetui_opts: igetui_opts.merge(pusher_type: 'push_message_to_list')})
NotificationStatistic.create_by_params(igetui_opts, message, device_ids_opts, params[:app_type])
# NotificationStatistic.create_by_params(igetui_opts, message, device_ids_opts, params[:app_type])
render json: { code: 0, message: 'success', data: {remind: "请使用新的api,此api近期将不再维护,请尽快迁移到新的api,新api地址 http://apidoc.weiwenjia.com/docs/internal-dev-api/internal-dev-api-1boq6ctdm8m57"}}
......
......@@ -17,14 +17,14 @@ class PushToolClient
if igetui_android_client_ids.present?
igetui_android_client_ids.each_pair do |app_type, ids|
Igetui::Pusher.new(ids, @opts.merge(device_platform: 'android', app_type: app_type)).perform
NotificationStatistic.static_notification(@opts.merge(app_type: app_type), ids,'igetui', 'android' )
# NotificationStatistic.static_notification(@opts.merge(app_type: app_type), ids,'igetui', 'android' )
end
end
if igetui_ios_client_ids.present?
igetui_ios_client_ids.each_pair do |app_type, ids|
Igetui::Pusher.new(ids, @opts.merge(device_platform: 'ios', app_type: app_type)).perform
NotificationStatistic.static_notification(@opts.merge(app_type: app_type), ids,'igetui', 'ios' )
# NotificationStatistic.static_notification(@opts.merge(app_type: app_type), ids,'igetui', 'ios' )
end
end
......@@ -37,7 +37,7 @@ class PushToolClient
xiaomi_client_ids.each_pair do |app_type, ids|
message = @opts[:message].merge(@opts[:message][:transmission_content] || {})
Xiaomi::Pusher.new(ids, message, app_type).perform
NotificationStatistic.static_notification(@opts.merge(app_type: app_type), ids,'xiaomi')
# NotificationStatistic.static_notification(@opts.merge(app_type: app_type), ids,'xiaomi')
end
end
......@@ -46,7 +46,7 @@ class PushToolClient
huawei_client_ids.each_pair do |app_type, ids|
message = @opts[:message].merge(@opts[:message][:transmission_content] || {})
Huawei::Pusher.new(ids, message, app_type).perform
NotificationStatistic.static_notification(@opts.merge(app_type: app_type), ids,'huawei')
# NotificationStatistic.static_notification(@opts.merge(app_type: app_type), ids,'huawei')
end
end
end
......
namespace :data_migrations do
namespace :version do
desc "batch delete notification_statistics data"
task :v1_batch_delete_notification_statistics_data => :environment do
last_object = NotificationStatistic.where("notification_statistics.created_at >= ?", '2020-05-30 16:00:00').first
puts "rake begin time is #{Time.now.to_s}"
NotificationStatistic.in_batches(of: 10000, finish: last_object ) {|records| records.delete_all} if last_object.present?
puts "rake end time is #{Time.now.to_s}"
end
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment