Commit 6aad7ca9 authored by Nick Thomas's avatar Nick Thomas

Resolve conflicts in user activity

parent fc57aab8
...@@ -14,11 +14,7 @@ module Users ...@@ -14,11 +14,7 @@ module Users
private private
def record_activity def record_activity
<<<<<<< HEAD
Gitlab::UserActivities.record(@author.id) unless Gitlab::Geo.secondary? Gitlab::UserActivities.record(@author.id) unless Gitlab::Geo.secondary?
=======
Gitlab::UserActivities.record(@author.id)
>>>>>>> ce/master
Rails.logger.debug("Recorded activity: #{@activity} for User ID: #{@author.id} (username: #{@author.username}") Rails.logger.debug("Recorded activity: #{@activity} for User ID: #{@author.id} (username: #{@author.username}")
end end
......
...@@ -3,11 +3,8 @@ class ScheduleUpdateUserActivityWorker ...@@ -3,11 +3,8 @@ class ScheduleUpdateUserActivityWorker
include CronjobQueue include CronjobQueue
def perform(batch_size = 500) def perform(batch_size = 500)
<<<<<<< HEAD
return if Gitlab::Geo.secondary? return if Gitlab::Geo.secondary?
=======
>>>>>>> ce/master
Gitlab::UserActivities.new.each_slice(batch_size) do |batch| Gitlab::UserActivities.new.each_slice(batch_size) do |batch|
UpdateUserActivityWorker.perform_async(Hash[batch]) UpdateUserActivityWorker.perform_async(Hash[batch])
end end
......
...@@ -3,11 +3,8 @@ class UpdateUserActivityWorker ...@@ -3,11 +3,8 @@ class UpdateUserActivityWorker
include DedicatedSidekiqQueue include DedicatedSidekiqQueue
def perform(pairs) def perform(pairs)
<<<<<<< HEAD
return if Gitlab::Geo.secondary? return if Gitlab::Geo.secondary?
=======
>>>>>>> ce/master
pairs = cast_data(pairs) pairs = cast_data(pairs)
ids = pairs.keys ids = pairs.keys
conditions = 'WHEN id = ? THEN ? ' * ids.length conditions = 'WHEN id = ? THEN ? ' * ids.length
......
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
- [pages, 1] - [pages, 1]
- [system_hook_push, 1] - [system_hook_push, 1]
- [update_user_activity, 1] - [update_user_activity, 1]
<<<<<<< HEAD
# EE specific queues # EE specific queues
- [geo, 1] - [geo, 1]
- [project_mirror, 1] - [project_mirror, 1]
...@@ -65,5 +64,4 @@ ...@@ -65,5 +64,4 @@
- [elastic_indexer, 1] - [elastic_indexer, 1]
- [elastic_commit_indexer, 1] - [elastic_commit_indexer, 1]
- [export_csv, 1] - [export_csv, 1]
=======
>>>>>>> ce/master
class CreateUserActivities < ActiveRecord::Migration class CreateUserActivities < ActiveRecord::Migration
<<<<<<< HEAD
# Set this constant to true if this migration requires downtime. # Set this constant to true if this migration requires downtime.
DOWNTIME = true DOWNTIME = true
...@@ -24,11 +23,6 @@ class CreateUserActivities < ActiveRecord::Migration ...@@ -24,11 +23,6 @@ class CreateUserActivities < ActiveRecord::Migration
t.belongs_to :user, index: { unique: true }, foreign_key: { on_delete: :cascade } t.belongs_to :user, index: { unique: true }, foreign_key: { on_delete: :cascade }
t.datetime :last_activity_at, null: false t.datetime :last_activity_at, null: false
end end
=======
DOWNTIME = false
# This migration is a no-op. It just exists to match EE.
def change
>>>>>>> ce/master
end end
end end
<<<<<<< HEAD
# See http://doc.gitlab.com/ce/development/migration_style_guide.html # See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab. # for more information on how to write migrations for GitLab.
=======
>>>>>>> ce/master
class DropUserActivitiesTable < ActiveRecord::Migration class DropUserActivitiesTable < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
DOWNTIME = false DOWNTIME = false
<<<<<<< HEAD
# When using the methods "add_concurrent_index" or "add_column_with_default" # When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an # you must disable the use of transactions as these methods can not run in an
# existing transaction. When using "add_concurrent_index" make sure that this # existing transaction. When using "add_concurrent_index" make sure that this
...@@ -34,9 +30,6 @@ class DropUserActivitiesTable < ActiveRecord::Migration ...@@ -34,9 +30,6 @@ class DropUserActivitiesTable < ActiveRecord::Migration
add_index "user_activities", ["user_id"], name: "index_user_activities_on_user_id", unique: true, using: :btree add_index "user_activities", ["user_id"], name: "index_user_activities_on_user_id", unique: true, using: :btree
end end
=======
# This migration is a no-op. It just exists to match EE.
def change
>>>>>>> ce/master
end end
end end
...@@ -38,7 +38,6 @@ describe Users::ActivityService, services: true do ...@@ -38,7 +38,6 @@ describe Users::ActivityService, services: true do
end end
end end
end end
<<<<<<< HEAD
context 'when in Geo secondary node' do context 'when in Geo secondary node' do
before { allow(Gitlab::Geo).to receive(:secondary?).and_return(true) } before { allow(Gitlab::Geo).to receive(:secondary?).and_return(true) }
...@@ -49,8 +48,6 @@ describe Users::ActivityService, services: true do ...@@ -49,8 +48,6 @@ describe Users::ActivityService, services: true do
expect(last_hour_user_ids).to eq([]) expect(last_hour_user_ids).to eq([])
end end
end end
=======
>>>>>>> ce/master
end end
def last_hour_user_ids def last_hour_user_ids
......
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