Skip to content

Commit

Permalink
Update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
melkor217 committed Jun 2, 2016
1 parent 6e57ef6 commit 5d7ff82
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/jobs/get_group_steam_info_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def perform(options = {})
options[:format] = :xml
if (uri = SteamId.steam_group_url(options))
begin
options.delete :format
record = SteamGroup.find_or_initialize_by(options) do |group|
doc = Nokogiri::XML(Net::HTTP.get(uri))
logger.debug("Getting info for player #{uri.to_s}")
Expand Down
1 change: 0 additions & 1 deletion app/jobs/get_player_steam_info_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def perform(options = {})
end

end
uniqueid.steamUpdated = Time.now
uniqueid.save
sleep 5 if self.queue_name != :urgent
end
Expand Down
4 changes: 2 additions & 2 deletions app/jobs/update_avatars_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ class UpdateAvatarsJob < ApplicationJob
queue_as :default

def perform()
UniqueId.where(steamUpdated: nil).order(playerId: :desc).limit(300).each do |id|
UniqueId.where(updated_at: nil).order(playerId: :desc).limit(300).each do |id|
GetPlayerSteamInfoJob.perform_later(game: id.game, uniqueId: id.uniqueId)
end
UniqueId.where('steamUpdated < ?', 3.days.ago).limit(100).each do |id|
UniqueId.where('updated_at < ?', 3.days.ago).limit(100).each do |id|
GetPlayerSteamInfoJob.perform_later(game: id.game, uniqueId: id.uniqueId)
end
end
Expand Down
6 changes: 6 additions & 0 deletions db/migrate/20160601214527_player_add_time_columns.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class PlayerAddTimeColumns < ActiveRecord::Migration[5.0]
def change
add_column :hlstats_PlayerUniqueIds , :created_at, :datetime
add_column :hlstats_PlayerUniqueIds , :updated_at, :datetime
end
end
4 changes: 3 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20160601181555) do
ActiveRecord::Schema.define(version: 20160601214527) do

create_table "geoLiteCity_Blocks", id: false, force: :cascade, options: "ENGINE=MyISAM DEFAULT CHARSET=utf8" do |t|
t.bigint "startIpNum", default: 0, null: false, unsigned: true
Expand Down Expand Up @@ -452,6 +452,8 @@
t.string "location"
t.string "customURL"
t.string "realname", collation: "utf8mb4_bin"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["playerId"], name: "playerId", using: :btree
end

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ services:
restart: unless-stopped
command: redis-server --save 60 1000
noxus:
restart: unless-stopped
env_file: ./secrets.env
depends_on:
- mysql
Expand Down

0 comments on commit 5d7ff82

Please sign in to comment.