toccatore 0.4.0 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +12 -3
- data/lib/toccatore/cli.rb +1 -1
- data/lib/toccatore/queue.rb +8 -2
- data/lib/toccatore/usage_update.rb +64 -52
- data/lib/toccatore/version.rb +1 -1
- data/spec/cli_spec.rb +4 -4
- data/spec/datacite_related_spec.rb +1 -1
- data/spec/factories/default.rb +22 -0
- data/spec/fixtures/event_data_resp_2 +4 -4
- data/spec/fixtures/events_empty.json +33 -0
- data/spec/fixtures/usage_event.json +1 -1
- data/spec/fixtures/usage_event_fail.json +1 -1
- data/spec/fixtures/usage_events.json +8 -8
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/datacite_related/should_query_by_related_identifier.yml +1 -1
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/usage_update/no_reports_in_the_queue/should_succeed_with_no_works.yml +66 -20
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_are_messages/should_return_the_data_for_one_message.yml +13 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_is_ONE_message/should_return_the_data_for_one_message.yml +13 -13
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_no_meessage_when_the_queue_is_empty.yml +95 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_one_message_when_there_are_multiple_messages.yml +95 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_total/when_is_working_with_AWS.yml +187 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_empty.yml +52 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_wrong.yml +1039 -80
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_a_single_item.yml +289 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/queue_url/should_return_always_correct_queue_url.yml +49 -0
- data/spec/queque_spec.rb +44 -58
- data/spec/spec_helper.rb +9 -1
- data/spec/usage_update_spec.rb +50 -60
- data/toccatore.gemspec +4 -0
- metadata +53 -6
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/usage_update/should_fail.yml +0 -150
- data/spec/fixtures/vcr_cassettes/Toccatore_CLI/usage_update/should_succeed_with_no_works.yml +0 -150
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_DataCite_Event_Data.yml +0 -199
data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_a_single_item.yml
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: put
|
|
5
|
+
uri: https://api.test.datacite.org/events/a17e783b-8214-451e-9b0d-077213c2acae
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"data":{"id":"a17e783b-8214-451e-9b0d-077213c2acae","type":"events","attributes":{"uuid":"a17e783b-8214-451e-9b0d-077213c2acae","message-action":"add","subj-id":"https://metrics.test.datacite.org/reports/2018-3-Dash","subj":{"pid":"https://metrics.test.datacite.org/reports/2018-3-Dash","issued":"2128-04-09"},"total":3,"obj-id":"https://doi.org/10.7291/d1q94r","relation-type-id":"total-dataset-investigations-regular","source-id":"datacite","source-token":"43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc","occurred-at":"2128-04-09","license":"https://creativecommons.org/publicdomain/zero/1.0/"}}}'
|
|
9
|
+
headers:
|
|
10
|
+
User-Agent:
|
|
11
|
+
- Maremma - https://github.com/datacite/maremma
|
|
12
|
+
Content-Type:
|
|
13
|
+
- application/json
|
|
14
|
+
Accept:
|
|
15
|
+
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
|
16
|
+
Authorization:
|
|
17
|
+
- Bearer <LAGOTTO_TOKEN>
|
|
18
|
+
response:
|
|
19
|
+
status:
|
|
20
|
+
code: 500
|
|
21
|
+
message: ''
|
|
22
|
+
headers:
|
|
23
|
+
Date:
|
|
24
|
+
- Sun, 27 May 2018 17:51:47 GMT
|
|
25
|
+
Content-Type:
|
|
26
|
+
- application/json; charset=UTF-8
|
|
27
|
+
Content-Length:
|
|
28
|
+
- '30851'
|
|
29
|
+
Connection:
|
|
30
|
+
- keep-alive
|
|
31
|
+
Status:
|
|
32
|
+
- 500 Internal Server Error
|
|
33
|
+
Vary:
|
|
34
|
+
- Origin
|
|
35
|
+
X-Runtime:
|
|
36
|
+
- '0.098917'
|
|
37
|
+
X-Request-Id:
|
|
38
|
+
- fe86a8de-1ac7-49f3-b63e-0b8c6b64d552
|
|
39
|
+
X-Powered-By:
|
|
40
|
+
- Phusion Passenger 5.3.1
|
|
41
|
+
Server:
|
|
42
|
+
- nginx/1.14.0 + Phusion Passenger 5.3.1
|
|
43
|
+
body:
|
|
44
|
+
encoding: UTF-8
|
|
45
|
+
string: '{"status":500,"error":"Internal Server Error","exception":"#\u003cActiveRecord::RecordNotUnique:
|
|
46
|
+
Mysql2::Error: Duplicate entry ''https://metrics.test.datacite.org/reports/2018-3-Dash-https://do''
|
|
47
|
+
for key ''index_events_on_multiple_columns'': UPDATE `events` SET `subj_id`
|
|
48
|
+
= ''https://metrics.test.datacite.org/reports/2018-3-Dash'', `source_token`
|
|
49
|
+
= ''43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc'', `updated_at` = ''2018-05-27 17:51:46'',
|
|
50
|
+
`subj` = ''{\\\"pid\\\":\\\"https://metrics.test.datacite.org/reports/2018-3-Dash\\\",\\\"issued\\\":\\\"2128-04-09\\\"}''
|
|
51
|
+
WHERE `events`.`id` = 337\u003e","traces":{"Application Trace":[{"id":58,"trace":"app/controllers/events_controller.rb:30:in
|
|
52
|
+
`update''"}],"Framework Trace":[{"id":0,"trace":"vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in
|
|
53
|
+
`_query''"},{"id":1,"trace":"vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in
|
|
54
|
+
`block in query''"},{"id":2,"trace":"vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in
|
|
55
|
+
`handle_interrupt''"},{"id":3,"trace":"vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in
|
|
56
|
+
`query''"},{"id":4,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in
|
|
57
|
+
`block (2 levels) in execute''"},{"id":5,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:48:in
|
|
58
|
+
`block in permit_concurrent_loads''"},{"id":6,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/concurrency/share_lock.rb:187:in
|
|
59
|
+
`yield_shares''"},{"id":7,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:47:in
|
|
60
|
+
`permit_concurrent_loads''"},{"id":8,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in
|
|
61
|
+
`block in execute''"},{"id":9,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:579:in
|
|
62
|
+
`block (2 levels) in log''"},{"id":10,"trace":"/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:in
|
|
63
|
+
`mon_synchronize''"},{"id":11,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:578:in
|
|
64
|
+
`block in log''"},{"id":12,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in
|
|
65
|
+
`instrument''"},{"id":13,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:569:in
|
|
66
|
+
`log''"},{"id":14,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in
|
|
67
|
+
`execute''"},{"id":15,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in
|
|
68
|
+
`execute''"},{"id":16,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:196:in
|
|
69
|
+
`execute_and_free''"},{"id":17,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/mysql/database_statements.rb:45:in
|
|
70
|
+
`exec_delete''"},{"id":18,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:157:in
|
|
71
|
+
`update''"},{"id":19,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:21:in
|
|
72
|
+
`update''"},{"id":20,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:197:in
|
|
73
|
+
`_update_record''"},{"id":21,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:695:in
|
|
74
|
+
`_update_row''"},{"id":22,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/locking/optimistic.rb:80:in
|
|
75
|
+
`_update_row''"},{"id":23,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:718:in
|
|
76
|
+
`_update_record''"},{"id":24,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/attribute_methods/dirty.rb:133:in
|
|
77
|
+
`_update_record''"},{"id":25,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:346:in
|
|
78
|
+
`block in _update_record''"},{"id":26,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:132:in
|
|
79
|
+
`run_callbacks''"},{"id":27,"trace":"vendor/bundle/ruby/2.4.0/gems/bugsnag-6.7.2/lib/bugsnag/integrations/rails/active_record_rescue.rb:25:in
|
|
80
|
+
`run_callbacks''"},{"id":28,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:816:in
|
|
81
|
+
`_run_update_callbacks''"},{"id":29,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:346:in
|
|
82
|
+
`_update_record''"},{"id":30,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/timestamp.rb:107:in
|
|
83
|
+
`_update_record''"},{"id":31,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:704:in
|
|
84
|
+
`create_or_update''"},{"id":32,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:338:in
|
|
85
|
+
`block in create_or_update''"},{"id":33,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:98:in
|
|
86
|
+
`run_callbacks''"},{"id":34,"trace":"vendor/bundle/ruby/2.4.0/gems/bugsnag-6.7.2/lib/bugsnag/integrations/rails/active_record_rescue.rb:25:in
|
|
87
|
+
`run_callbacks''"},{"id":35,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:816:in
|
|
88
|
+
`_run_save_callbacks''"},{"id":36,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:338:in
|
|
89
|
+
`create_or_update''"},{"id":37,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:275:in
|
|
90
|
+
`save''"},{"id":38,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/validations.rb:46:in
|
|
91
|
+
`save''"},{"id":39,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:310:in
|
|
92
|
+
`block (2 levels) in save''"},{"id":40,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:386:in
|
|
93
|
+
`block in with_transaction_returning_status''"},{"id":41,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:252:in
|
|
94
|
+
`transaction''"},{"id":42,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:212:in
|
|
95
|
+
`transaction''"},{"id":43,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:383:in
|
|
96
|
+
`with_transaction_returning_status''"},{"id":44,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:310:in
|
|
97
|
+
`block in save''"},{"id":45,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:325:in
|
|
98
|
+
`rollback_active_record_state!''"},{"id":46,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:309:in
|
|
99
|
+
`save''"},{"id":47,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/suppressor.rb:44:in
|
|
100
|
+
`save''"},{"id":48,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:428:in
|
|
101
|
+
`block in update''"},{"id":49,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:386:in
|
|
102
|
+
`block in with_transaction_returning_status''"},{"id":50,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in
|
|
103
|
+
`block in transaction''"},{"id":51,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:230:in
|
|
104
|
+
`block in within_new_transaction''"},{"id":52,"trace":"/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:in
|
|
105
|
+
`mon_synchronize''"},{"id":53,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:227:in
|
|
106
|
+
`within_new_transaction''"},{"id":54,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in
|
|
107
|
+
`transaction''"},{"id":55,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:212:in
|
|
108
|
+
`transaction''"},{"id":56,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:383:in
|
|
109
|
+
`with_transaction_returning_status''"},{"id":57,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:426:in
|
|
110
|
+
`update''"},{"id":59,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/basic_implicit_render.rb:6:in
|
|
111
|
+
`send_action''"},{"id":60,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:194:in
|
|
112
|
+
`process_action''"},{"id":61,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/rendering.rb:30:in
|
|
113
|
+
`process_action''"},{"id":62,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:42:in
|
|
114
|
+
`block in process_action''"},{"id":63,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:132:in
|
|
115
|
+
`run_callbacks''"},{"id":64,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:41:in
|
|
116
|
+
`process_action''"},{"id":65,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/rescue.rb:22:in
|
|
117
|
+
`process_action''"},{"id":66,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:34:in
|
|
118
|
+
`block in process_action''"},{"id":67,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in
|
|
119
|
+
`block in instrument''"},{"id":68,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in
|
|
120
|
+
`instrument''"},{"id":69,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in
|
|
121
|
+
`instrument''"},{"id":70,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:32:in
|
|
122
|
+
`process_action''"},{"id":71,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/params_wrapper.rb:256:in
|
|
123
|
+
`process_action''"},{"id":72,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/railties/controller_runtime.rb:24:in
|
|
124
|
+
`process_action''"},{"id":73,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:134:in
|
|
125
|
+
`process''"},{"id":74,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:191:in
|
|
126
|
+
`dispatch''"},{"id":75,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:252:in
|
|
127
|
+
`dispatch''"},{"id":76,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:52:in
|
|
128
|
+
`dispatch''"},{"id":77,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:34:in
|
|
129
|
+
`serve''"},{"id":78,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:52:in
|
|
130
|
+
`block in serve''"},{"id":79,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in
|
|
131
|
+
`each''"},{"id":80,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in
|
|
132
|
+
`serve''"},{"id":81,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:840:in
|
|
133
|
+
`call''"},{"id":82,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/deflater.rb:34:in
|
|
134
|
+
`call''"},{"id":83,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/etag.rb:25:in
|
|
135
|
+
`call''"},{"id":84,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in
|
|
136
|
+
`call''"},{"id":85,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/head.rb:12:in
|
|
137
|
+
`call''"},{"id":86,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:559:in
|
|
138
|
+
`call''"},{"id":87,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:28:in
|
|
139
|
+
`block in call''"},{"id":88,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:98:in
|
|
140
|
+
`run_callbacks''"},{"id":89,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:26:in
|
|
141
|
+
`call''"},{"id":90,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in
|
|
142
|
+
`call''"},{"id":91,"trace":"vendor/bundle/ruby/2.4.0/gems/bugsnag-6.7.2/lib/bugsnag/integrations/rack.rb:46:in
|
|
143
|
+
`call''"},{"id":92,"trace":"vendor/bundle/ruby/2.4.0/gems/better_errors-2.4.0/lib/better_errors/middleware.rb:59:in
|
|
144
|
+
`call''"},{"id":93,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:61:in
|
|
145
|
+
`call''"},{"id":94,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/show_exceptions.rb:33:in
|
|
146
|
+
`call''"},{"id":95,"trace":"vendor/bundle/ruby/2.4.0/gems/lograge-0.10.0/lib/lograge/rails_ext/rack/logger.rb:15:in
|
|
147
|
+
`call_app''"},{"id":96,"trace":"vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:26:in
|
|
148
|
+
`block in call''"},{"id":97,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:71:in
|
|
149
|
+
`block in tagged''"},{"id":98,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:28:in
|
|
150
|
+
`tagged''"},{"id":99,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:71:in
|
|
151
|
+
`tagged''"},{"id":100,"trace":"vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:26:in
|
|
152
|
+
`call''"},{"id":101,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/remote_ip.rb:81:in
|
|
153
|
+
`call''"},{"id":102,"trace":"vendor/bundle/ruby/2.4.0/gems/request_store-1.4.1/lib/request_store/middleware.rb:19:in
|
|
154
|
+
`call''"},{"id":103,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/request_id.rb:27:in
|
|
155
|
+
`call''"},{"id":104,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/runtime.rb:22:in
|
|
156
|
+
`call''"},{"id":105,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in
|
|
157
|
+
`call''"},{"id":106,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in
|
|
158
|
+
`call''"},{"id":107,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/static.rb:127:in
|
|
159
|
+
`call''"},{"id":108,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in
|
|
160
|
+
`call''"},{"id":109,"trace":"vendor/bundle/ruby/2.4.0/gems/librato-rack-1.1.0/lib/librato/rack.rb:111:in
|
|
161
|
+
`process_request''"},{"id":110,"trace":"vendor/bundle/ruby/2.4.0/gems/librato-rack-1.1.0/lib/librato/rack.rb:81:in
|
|
162
|
+
`call''"},{"id":111,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-cors-1.0.2/lib/rack/cors.rb:97:in
|
|
163
|
+
`call''"},{"id":112,"trace":"vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:524:in
|
|
164
|
+
`call''"},{"id":113,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in
|
|
165
|
+
`process_request''"},{"id":114,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:157:in
|
|
166
|
+
`accept_and_process_next_request''"},{"id":115,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in
|
|
167
|
+
`main_loop''"},{"id":116,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in
|
|
168
|
+
`block (3 levels) in start_threads''"},{"id":117,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in
|
|
169
|
+
`block in create_thread_and_abort_on_exception''"}],"Full Trace":[{"id":0,"trace":"vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in
|
|
170
|
+
`_query''"},{"id":1,"trace":"vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:120:in
|
|
171
|
+
`block in query''"},{"id":2,"trace":"vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in
|
|
172
|
+
`handle_interrupt''"},{"id":3,"trace":"vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.10/lib/mysql2/client.rb:119:in
|
|
173
|
+
`query''"},{"id":4,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in
|
|
174
|
+
`block (2 levels) in execute''"},{"id":5,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:48:in
|
|
175
|
+
`block in permit_concurrent_loads''"},{"id":6,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/concurrency/share_lock.rb:187:in
|
|
176
|
+
`yield_shares''"},{"id":7,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:47:in
|
|
177
|
+
`permit_concurrent_loads''"},{"id":8,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in
|
|
178
|
+
`block in execute''"},{"id":9,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:579:in
|
|
179
|
+
`block (2 levels) in log''"},{"id":10,"trace":"/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:in
|
|
180
|
+
`mon_synchronize''"},{"id":11,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:578:in
|
|
181
|
+
`block in log''"},{"id":12,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in
|
|
182
|
+
`instrument''"},{"id":13,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:569:in
|
|
183
|
+
`log''"},{"id":14,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in
|
|
184
|
+
`execute''"},{"id":15,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in
|
|
185
|
+
`execute''"},{"id":16,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:196:in
|
|
186
|
+
`execute_and_free''"},{"id":17,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/mysql/database_statements.rb:45:in
|
|
187
|
+
`exec_delete''"},{"id":18,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:157:in
|
|
188
|
+
`update''"},{"id":19,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:21:in
|
|
189
|
+
`update''"},{"id":20,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:197:in
|
|
190
|
+
`_update_record''"},{"id":21,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:695:in
|
|
191
|
+
`_update_row''"},{"id":22,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/locking/optimistic.rb:80:in
|
|
192
|
+
`_update_row''"},{"id":23,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:718:in
|
|
193
|
+
`_update_record''"},{"id":24,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/attribute_methods/dirty.rb:133:in
|
|
194
|
+
`_update_record''"},{"id":25,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:346:in
|
|
195
|
+
`block in _update_record''"},{"id":26,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:132:in
|
|
196
|
+
`run_callbacks''"},{"id":27,"trace":"vendor/bundle/ruby/2.4.0/gems/bugsnag-6.7.2/lib/bugsnag/integrations/rails/active_record_rescue.rb:25:in
|
|
197
|
+
`run_callbacks''"},{"id":28,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:816:in
|
|
198
|
+
`_run_update_callbacks''"},{"id":29,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:346:in
|
|
199
|
+
`_update_record''"},{"id":30,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/timestamp.rb:107:in
|
|
200
|
+
`_update_record''"},{"id":31,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:704:in
|
|
201
|
+
`create_or_update''"},{"id":32,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:338:in
|
|
202
|
+
`block in create_or_update''"},{"id":33,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:98:in
|
|
203
|
+
`run_callbacks''"},{"id":34,"trace":"vendor/bundle/ruby/2.4.0/gems/bugsnag-6.7.2/lib/bugsnag/integrations/rails/active_record_rescue.rb:25:in
|
|
204
|
+
`run_callbacks''"},{"id":35,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:816:in
|
|
205
|
+
`_run_save_callbacks''"},{"id":36,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/callbacks.rb:338:in
|
|
206
|
+
`create_or_update''"},{"id":37,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:275:in
|
|
207
|
+
`save''"},{"id":38,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/validations.rb:46:in
|
|
208
|
+
`save''"},{"id":39,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:310:in
|
|
209
|
+
`block (2 levels) in save''"},{"id":40,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:386:in
|
|
210
|
+
`block in with_transaction_returning_status''"},{"id":41,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:252:in
|
|
211
|
+
`transaction''"},{"id":42,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:212:in
|
|
212
|
+
`transaction''"},{"id":43,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:383:in
|
|
213
|
+
`with_transaction_returning_status''"},{"id":44,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:310:in
|
|
214
|
+
`block in save''"},{"id":45,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:325:in
|
|
215
|
+
`rollback_active_record_state!''"},{"id":46,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:309:in
|
|
216
|
+
`save''"},{"id":47,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/suppressor.rb:44:in
|
|
217
|
+
`save''"},{"id":48,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:428:in
|
|
218
|
+
`block in update''"},{"id":49,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:386:in
|
|
219
|
+
`block in with_transaction_returning_status''"},{"id":50,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in
|
|
220
|
+
`block in transaction''"},{"id":51,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:230:in
|
|
221
|
+
`block in within_new_transaction''"},{"id":52,"trace":"/usr/local/rvm/rubies/ruby-2.4.4/lib/ruby/2.4.0/monitor.rb:214:in
|
|
222
|
+
`mon_synchronize''"},{"id":53,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:227:in
|
|
223
|
+
`within_new_transaction''"},{"id":54,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:254:in
|
|
224
|
+
`transaction''"},{"id":55,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:212:in
|
|
225
|
+
`transaction''"},{"id":56,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/transactions.rb:383:in
|
|
226
|
+
`with_transaction_returning_status''"},{"id":57,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/persistence.rb:426:in
|
|
227
|
+
`update''"},{"id":58,"trace":"app/controllers/events_controller.rb:30:in `update''"},{"id":59,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/basic_implicit_render.rb:6:in
|
|
228
|
+
`send_action''"},{"id":60,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:194:in
|
|
229
|
+
`process_action''"},{"id":61,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/rendering.rb:30:in
|
|
230
|
+
`process_action''"},{"id":62,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:42:in
|
|
231
|
+
`block in process_action''"},{"id":63,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:132:in
|
|
232
|
+
`run_callbacks''"},{"id":64,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:41:in
|
|
233
|
+
`process_action''"},{"id":65,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/rescue.rb:22:in
|
|
234
|
+
`process_action''"},{"id":66,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:34:in
|
|
235
|
+
`block in process_action''"},{"id":67,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in
|
|
236
|
+
`block in instrument''"},{"id":68,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in
|
|
237
|
+
`instrument''"},{"id":69,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in
|
|
238
|
+
`instrument''"},{"id":70,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:32:in
|
|
239
|
+
`process_action''"},{"id":71,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/params_wrapper.rb:256:in
|
|
240
|
+
`process_action''"},{"id":72,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/railties/controller_runtime.rb:24:in
|
|
241
|
+
`process_action''"},{"id":73,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:134:in
|
|
242
|
+
`process''"},{"id":74,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:191:in
|
|
243
|
+
`dispatch''"},{"id":75,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:252:in
|
|
244
|
+
`dispatch''"},{"id":76,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:52:in
|
|
245
|
+
`dispatch''"},{"id":77,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:34:in
|
|
246
|
+
`serve''"},{"id":78,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:52:in
|
|
247
|
+
`block in serve''"},{"id":79,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in
|
|
248
|
+
`each''"},{"id":80,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in
|
|
249
|
+
`serve''"},{"id":81,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:840:in
|
|
250
|
+
`call''"},{"id":82,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/deflater.rb:34:in
|
|
251
|
+
`call''"},{"id":83,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/etag.rb:25:in
|
|
252
|
+
`call''"},{"id":84,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in
|
|
253
|
+
`call''"},{"id":85,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/head.rb:12:in
|
|
254
|
+
`call''"},{"id":86,"trace":"vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/migration.rb:559:in
|
|
255
|
+
`call''"},{"id":87,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:28:in
|
|
256
|
+
`block in call''"},{"id":88,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:98:in
|
|
257
|
+
`run_callbacks''"},{"id":89,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:26:in
|
|
258
|
+
`call''"},{"id":90,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in
|
|
259
|
+
`call''"},{"id":91,"trace":"vendor/bundle/ruby/2.4.0/gems/bugsnag-6.7.2/lib/bugsnag/integrations/rack.rb:46:in
|
|
260
|
+
`call''"},{"id":92,"trace":"vendor/bundle/ruby/2.4.0/gems/better_errors-2.4.0/lib/better_errors/middleware.rb:59:in
|
|
261
|
+
`call''"},{"id":93,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:61:in
|
|
262
|
+
`call''"},{"id":94,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/show_exceptions.rb:33:in
|
|
263
|
+
`call''"},{"id":95,"trace":"vendor/bundle/ruby/2.4.0/gems/lograge-0.10.0/lib/lograge/rails_ext/rack/logger.rb:15:in
|
|
264
|
+
`call_app''"},{"id":96,"trace":"vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:26:in
|
|
265
|
+
`block in call''"},{"id":97,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:71:in
|
|
266
|
+
`block in tagged''"},{"id":98,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:28:in
|
|
267
|
+
`tagged''"},{"id":99,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/tagged_logging.rb:71:in
|
|
268
|
+
`tagged''"},{"id":100,"trace":"vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:26:in
|
|
269
|
+
`call''"},{"id":101,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/remote_ip.rb:81:in
|
|
270
|
+
`call''"},{"id":102,"trace":"vendor/bundle/ruby/2.4.0/gems/request_store-1.4.1/lib/request_store/middleware.rb:19:in
|
|
271
|
+
`call''"},{"id":103,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/request_id.rb:27:in
|
|
272
|
+
`call''"},{"id":104,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/runtime.rb:22:in
|
|
273
|
+
`call''"},{"id":105,"trace":"vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in
|
|
274
|
+
`call''"},{"id":106,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in
|
|
275
|
+
`call''"},{"id":107,"trace":"vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/static.rb:127:in
|
|
276
|
+
`call''"},{"id":108,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in
|
|
277
|
+
`call''"},{"id":109,"trace":"vendor/bundle/ruby/2.4.0/gems/librato-rack-1.1.0/lib/librato/rack.rb:111:in
|
|
278
|
+
`process_request''"},{"id":110,"trace":"vendor/bundle/ruby/2.4.0/gems/librato-rack-1.1.0/lib/librato/rack.rb:81:in
|
|
279
|
+
`call''"},{"id":111,"trace":"vendor/bundle/ruby/2.4.0/gems/rack-cors-1.0.2/lib/rack/cors.rb:97:in
|
|
280
|
+
`call''"},{"id":112,"trace":"vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:524:in
|
|
281
|
+
`call''"},{"id":113,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in
|
|
282
|
+
`process_request''"},{"id":114,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:157:in
|
|
283
|
+
`accept_and_process_next_request''"},{"id":115,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in
|
|
284
|
+
`main_loop''"},{"id":116,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in
|
|
285
|
+
`block (3 levels) in start_threads''"},{"id":117,"trace":"/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in
|
|
286
|
+
`block in create_thread_and_abort_on_exception''"}]}}'
|
|
287
|
+
http_version:
|
|
288
|
+
recorded_at: Sun, 27 May 2018 17:51:47 GMT
|
|
289
|
+
recorded_with: VCR 3.0.3
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: https://sqs.eu-west-1.amazonaws.com/
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: Action=GetQueueUrl&QueueName=test_usage&Version=2012-11-05
|
|
9
|
+
headers:
|
|
10
|
+
Content-Type:
|
|
11
|
+
- application/x-www-form-urlencoded; charset=utf-8
|
|
12
|
+
Accept-Encoding:
|
|
13
|
+
- ''
|
|
14
|
+
User-Agent:
|
|
15
|
+
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
|
16
|
+
X-Amz-Date:
|
|
17
|
+
- 20180528T101149Z
|
|
18
|
+
X-Amz-Content-Sha256:
|
|
19
|
+
- 5761efd13dd0ed81182207171d3660628968189941431d6044920ef8fe7b1160
|
|
20
|
+
Authorization:
|
|
21
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180528/eu-west-1/sqs/aws4_request,
|
|
22
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=27a47caa3eef618bb34d16a20b68bbd2e687dd9dfbd0a8916de116b4018715a8
|
|
23
|
+
Content-Length:
|
|
24
|
+
- '58'
|
|
25
|
+
Accept:
|
|
26
|
+
- "*/*"
|
|
27
|
+
response:
|
|
28
|
+
status:
|
|
29
|
+
code: 200
|
|
30
|
+
message: OK
|
|
31
|
+
headers:
|
|
32
|
+
Server:
|
|
33
|
+
- Server
|
|
34
|
+
Date:
|
|
35
|
+
- Mon, 28 May 2018 10:11:49 GMT
|
|
36
|
+
Content-Type:
|
|
37
|
+
- text/xml
|
|
38
|
+
Content-Length:
|
|
39
|
+
- '330'
|
|
40
|
+
Connection:
|
|
41
|
+
- keep-alive
|
|
42
|
+
X-Amzn-Requestid:
|
|
43
|
+
- 9f9d4e4a-0871-5085-ae8d-1dcfd054721c
|
|
44
|
+
body:
|
|
45
|
+
encoding: UTF-8
|
|
46
|
+
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>9f9d4e4a-0871-5085-ae8d-1dcfd054721c</RequestId></ResponseMetadata></GetQueueUrlResponse>
|
|
47
|
+
http_version:
|
|
48
|
+
recorded_at: Mon, 28 May 2018 10:11:49 GMT
|
|
49
|
+
recorded_with: VCR 3.0.3
|
data/spec/queque_spec.rb
CHANGED
|
@@ -1,61 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
describe Toccatore::UsageUpdate, vcr: true do
|
|
4
4
|
|
|
5
|
-
# # let(:queue_url){"https://sqs.#{ENV['AWS_REGION']}.amazonaws.com/404017989009/test_usage"}
|
|
6
|
-
# # let(:queue_name){:test_usage}
|
|
7
|
-
|
|
8
|
-
# # before do
|
|
9
|
-
# # # subject.new({:stub_responses => true})
|
|
10
|
-
# # body = File.read(fixture_path + 'usage_event.json')
|
|
11
|
-
# # result = OpenStruct.new(body: JSON.parse(body) )
|
|
12
|
-
# # subject.loopy.stub_responses(:create_queue, queue_url: queue_url)
|
|
13
|
-
# # subject.loopy.send_message({queue_url: queue_url, message_body:result.to_json})
|
|
14
|
-
# # end
|
|
15
5
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
#
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
# end
|
|
59
|
-
# end
|
|
60
|
-
|
|
61
|
-
# end
|
|
6
|
+
context "get_total" do
|
|
7
|
+
it "when is working with AWS" do
|
|
8
|
+
expect(subject.get_total()).to respond_to(:+)
|
|
9
|
+
expect(subject.get_total()).not_to respond_to(:each)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
context "queue_url" do
|
|
14
|
+
it "should return always correct queue url" do
|
|
15
|
+
response = subject.queue_url
|
|
16
|
+
expect(response).to eq("https://sqs.#{ENV['AWS_REGION']}.amazonaws.com/404017989009/#{ENV['ENVIRONMENT']}_usage")
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "should fail if the queue doesn exist" do
|
|
20
|
+
# response = subject.queue_url({ queue_name: "magic_usage" })
|
|
21
|
+
# expect(response).to eq("https://sqs.#{ENV['AWS_REGION']}.amazonaws.com/404017989009/#{ENV['ENVIRONMENT']}_usage")
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
context "get_message" do
|
|
26
|
+
it "should return one message when there are multiple messages" do
|
|
27
|
+
expect(subject.get_message).to respond_to(:messages)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "should return no meessage when the queue is empty" do
|
|
31
|
+
expect(subject.get_message).not_to respond_to(:+)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# context "delete_message" do
|
|
36
|
+
# it "should delete a message that exist" do
|
|
37
|
+
# msg = subject.get_message
|
|
38
|
+
# response = subject.delete_message msg
|
|
39
|
+
# expect(response.successful?).to eq(true)
|
|
40
|
+
# end
|
|
41
|
+
|
|
42
|
+
# it "should return an error if a message doesnot exist" do
|
|
43
|
+
|
|
44
|
+
# end
|
|
45
|
+
# end
|
|
46
|
+
|
|
47
|
+
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -12,7 +12,9 @@ require 'webmock/rspec'
|
|
|
12
12
|
require 'nokogiri'
|
|
13
13
|
require 'vcr'
|
|
14
14
|
require 'aws-sdk-sqs'
|
|
15
|
-
|
|
15
|
+
require 'factory_bot'
|
|
16
|
+
ENV['ENVIRONMENT'] ||= 'test'
|
|
17
|
+
ENV['AWS_REGION'] ||= 'eu-west-1'
|
|
16
18
|
|
|
17
19
|
RSpec.configure do |config|
|
|
18
20
|
config.order = :random
|
|
@@ -22,6 +24,12 @@ RSpec.configure do |config|
|
|
|
22
24
|
c.syntax = :expect
|
|
23
25
|
end
|
|
24
26
|
|
|
27
|
+
config.include FactoryBot::Syntax::Methods
|
|
28
|
+
|
|
29
|
+
config.before(:suite) do
|
|
30
|
+
FactoryBot.find_definitions
|
|
31
|
+
end
|
|
32
|
+
|
|
25
33
|
config.mock_with :rspec do |mocks|
|
|
26
34
|
mocks.allow_message_expectations_on_nil = false
|
|
27
35
|
end
|