caddie 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1396d115e54642bf6f73ee59355b6e6e4e5129e9
4
- data.tar.gz: 29281a054f60e749562323fe38c3074ac0cb2386
3
+ metadata.gz: 756e5e77635428dc2ec0fd138670ac328ba192d0
4
+ data.tar.gz: dd8ac350a16fd5cce2c82b311c2389088c51a865
5
5
  SHA512:
6
- metadata.gz: c0145fefa908bda2dfb247b99233e493b201dcff52f78d96373179f184ed1bc9d2186a194d113d950b18cfc6c8f50b4193ef547a2ccbca4c77048df4844bc98c
7
- data.tar.gz: 68a89f32ac8044dacc77db3756e5e57bab67322bd7ec5fff36d429d61341775e9d5de6d90dac3a5e34f3bafca5afce6ea535240d7311060affbfa35483204b19
6
+ metadata.gz: 157f3548fecdb91b9f53fa2a1286792450ddf567cc3c03b4bd172249f9de35153b4c66f716146e4b783d10b6d5cde6300545aff49c9c6ce8afc8a2aa1c6aefa9
7
+ data.tar.gz: 25304ceaa3c8dfc8d24bd519b40069383dc2bf55690054fd50b1cac84a5618c93b4f2954cf4970b31d14450df42f581c8bb7112e04c26e1951b58c2dad6318fd
@@ -7,7 +7,7 @@ module Caddie
7
7
 
8
8
  def get_markets( region_id, type_id )
9
9
  type_url = "https://crest-tq.eveonline.com/inventory/types/#{type_id}"
10
- items, connections_count = get_multipage_data( "market/#{region_id}/history/?type=#{type_url}", true )
10
+ items, connections_count = get_multipage_data( "market/#{region_id}/history/?type=#{type_url}", false )
11
11
  [ items, connections_count ]
12
12
  end
13
13
 
@@ -28,13 +28,13 @@ UPDATE caddie_crest_price_history_updates cphu SET nb_days = ( CURRENT_DATE - ma
28
28
 
29
29
  UPDATE caddie_crest_price_history_updates cphu
30
30
  SET process_queue = 'DAILY', next_process_date = current_date, process_queue_priority = 1
31
- WHERE nb_days <=40;
32
-
33
- -- UPDATE caddie_crest_price_history_updates cphu
34
- -- SET process_queue = 'WEEKLY', next_process_date = date_trunc( 'week', ( current_date + ( interval '1 week' ) ) ), process_queue_priority = 2
35
- -- WHERE nb_days <= 30 AND nb_days > 7;
36
- --
37
- -- UPDATE caddie_crest_price_history_updates cphu
38
- -- SET process_queue = 'MONTHLY', next_process_date = date_trunc( 'month', ( current_date + ( interval '1 month' ) ) ), process_queue_priority = 3
39
- -- WHERE nb_days > 30 OR nb_days IS NULL;
40
- --
31
+ WHERE nb_days <= 7;
32
+
33
+ UPDATE caddie_crest_price_history_updates cphu
34
+ SET process_queue = 'WEEKLY', next_process_date = date_trunc( 'week', ( current_date + ( interval '1 week' ) ) ), process_queue_priority = 2
35
+ WHERE nb_days <= 30 AND nb_days > 7;
36
+
37
+ UPDATE caddie_crest_price_history_updates cphu
38
+ SET process_queue = 'MONTHLY', next_process_date = date_trunc( 'month', ( current_date + ( interval '1 month' ) ) ), process_queue_priority = 3
39
+ WHERE nb_days > 30 OR nb_days IS NULL;
40
+
@@ -0,0 +1,5 @@
1
+ class AddTotalInsertsToCrestPriceHistoryUpdateLog < ActiveRecord::Migration
2
+ def change
3
+ add_column :caddie_crest_price_history_update_logs, :total_inserts, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddCoSecondsToCrestPriceHistoryUpdateLog < ActiveRecord::Migration
2
+ def change
3
+ add_column :caddie_crest_price_history_update_logs, :co_seconds, :float
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Caddie
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -19,8 +19,8 @@ namespace :caddie do
19
19
  end_feeding_time = Time.now
20
20
  feeding_time = end_feeding_time - end_update_time
21
21
 
22
- Caddie::CrestPriceHistoryUpdateLog.create!(
23
- feed_date: feed_date, update_planning_time: update_planning_time, feeding_time: feeding_time )
22
+ Caddie::CrestPriceHistoryUpdateLog.create!( feed_date: feed_date, update_planning_time: update_planning_time,
23
+ feeding_time: feeding_time, total_inserts: total_inserts, co_seconds: total_connections.to_f / total_time )
24
24
 
25
25
  end
26
26
  end
@@ -54291,3 +54291,8 @@ Could not log "sql.active_record" event. Interrupt: ["/home/ced/.rvm/gems/ruby-
54291
54291
   (0.4ms) BEGIN
54292
54292
   (1.9ms) SELECT "crest_price_histories"."day_timestamp" FROM "crest_price_histories" WHERE "crest_price_histories"."region_id" = $1 AND "crest_price_histories"."eve_item_id" = $2 [["region_id", 49], ["eve_item_id", 2362]]
54293
54293
   (0.6ms) COMMIT
54294
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
54295
+ Migrating to CreateCaddieCrestPriceHistoryUpdates (20160524122651)
54296
+  (0.1ms) BEGIN
54297
+  (9.6ms) CREATE TABLE "caddie_crest_price_history_updates" ("id" serial primary key, "eve_item_id" integer, "region_id" integer, "max_update" date, "max_eve_item_create" date, "max_region_create" date, "max_date" date, "nb_days" integer, "process_queue" character varying, "process_queue_priority" integer, "next_process_date" date, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
54298
+  (0.2ms) ROLLBACK
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caddie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuger Cédric
@@ -77,6 +77,8 @@ files:
77
77
  - db/migrate/20160524122651_create_caddie_crest_price_history_updates.rb
78
78
  - db/migrate/20160527152027_add_thread_slice_id_to_caddie_crest_price_history_updates.rb
79
79
  - db/migrate/20160707153021_create_caddie_crest_price_history_update_logs.rb
80
+ - db/migrate/20160710163612_add_total_inserts_to_crest_price_history_update_log.rb
81
+ - db/migrate/20160710163641_add_co_seconds_to_crest_price_history_update_log.rb
80
82
  - lib/caddie.rb
81
83
  - lib/caddie/engine.rb
82
84
  - lib/caddie/version.rb