async_request 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async_request/engine.rb +4 -4
- data/lib/async_request/version.rb +1 -1
- data/lib/async_request.rb +1 -1
- data/lib/generators/async_request_generator.rb +4 -5
- data/lib/templates/create_async_request_jobs.rb +1 -1
- data/spec/dummy/log/test.log +198 -0
- data/spec/spec_helper.rb +6 -7
- metadata +33 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2eeeff73b4c3b9fda39e0c8f4b12c64002c55e89
|
4
|
+
data.tar.gz: f26dc2c97e4311e54e8a62becc788498099e6d44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17fab72b105fe4dfb1e172ad5efd7007c7fbb92e8aa073f147e9533042a6ccaa750a88065c7942dd171312cf88fd158e62eb53f11c4b12818f01e742076a42b9
|
7
|
+
data.tar.gz: ca10915c8ecd445d2d81e34394e445ada1ec4a00ebcfdbdc04610bbcf0d1608dbe02e554e32c3983bf0f4305fb08cddf47f9fddd3bafb695621d0efe6019c930
|
data/lib/async_request/engine.rb
CHANGED
@@ -3,14 +3,14 @@ module AsyncRequest
|
|
3
3
|
class Engine < ::Rails::Engine
|
4
4
|
isolate_namespace AsyncRequest
|
5
5
|
|
6
|
-
initializer
|
6
|
+
initializer 'async_request', before: :load_config_initializers do |app|
|
7
7
|
Rails.application.routes.append do
|
8
|
-
mount AsyncRequest::Engine, at:
|
8
|
+
mount AsyncRequest::Engine, at: '/async_request'
|
9
9
|
end
|
10
10
|
|
11
11
|
unless app.root.to_s.match root.to_s
|
12
|
-
config.paths[
|
13
|
-
Rails.application.config.paths[
|
12
|
+
config.paths['db/migrate'].expanded.each do |expanded_path|
|
13
|
+
Rails.application.config.paths['db/migrate'] << expanded_path
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/lib/async_request.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
require 'rails/generators/base'
|
2
2
|
|
3
|
-
|
4
3
|
class AsyncRequestGenerator < Rails::Generators::Base
|
5
|
-
source_root File.expand_path(
|
4
|
+
source_root File.expand_path('../../templates', __FILE__)
|
6
5
|
|
7
6
|
def copy_initializer_file
|
8
|
-
file_name =
|
9
|
-
now = DateTime.current.strftime(
|
7
|
+
file_name = 'create_async_request_jobs.rb'
|
8
|
+
now = DateTime.current.strftime('%Y%m%d%H%M%S')
|
10
9
|
copy_file file_name, "db/migrate/#{now}_#{file_name}"
|
11
10
|
end
|
12
|
-
end
|
11
|
+
end
|
data/spec/dummy/log/test.log
CHANGED
@@ -5074,3 +5074,201 @@ WHERE c.contype = 'f'
|
|
5074
5074
|
AND t3.nspname = ANY (current_schemas(false))
|
5075
5075
|
ORDER BY c.conname
|
5076
5076
|
[0m
|
5077
|
+
[1m[36mActiveRecord::SchemaMigration Load (1.6ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5078
|
+
[1m[36m (103.7ms)[0m [1mDROP DATABASE IF EXISTS "dummy_test"[0m
|
5079
|
+
[1m[35m (259.3ms)[0m CREATE DATABASE "dummy_test" ENCODING = 'unicode'
|
5080
|
+
[1m[36mSQL (0.2ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
5081
|
+
[1m[35m (10.5ms)[0m CREATE TABLE "async_request_jobs" ("id" serial primary key, "worker" character varying, "status" integer, "status_code" integer, "response" text, "uid" character varying, "params" text, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
5082
|
+
[1m[36m (4.6ms)[0m [1mCREATE INDEX "index_async_request_jobs_on_status" ON "async_request_jobs" USING btree ("status")[0m
|
5083
|
+
[1m[35m (3.3ms)[0m CREATE UNIQUE INDEX "index_async_request_jobs_on_uid" ON "async_request_jobs" USING btree ("uid")
|
5084
|
+
[1m[36m (4.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
5085
|
+
[1m[35m (4.2ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
5086
|
+
[1m[36m (0.3ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
5087
|
+
[1m[35m (0.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160411190611')
|
5088
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5089
|
+
[1m[36m (0.4ms)[0m [1mALTER TABLE "async_request_jobs" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL[0m
|
5090
|
+
[1m[35m (1.2ms)[0m SELECT schemaname || '.' || tablename
|
5091
|
+
FROM pg_tables
|
5092
|
+
WHERE
|
5093
|
+
tablename !~ '_prt_' AND
|
5094
|
+
tablename <> 'schema_migrations' AND
|
5095
|
+
schemaname = ANY (current_schemas(false))
|
5096
|
+
|
5097
|
+
[1m[36m (1.1ms)[0m [1mselect table_name from information_schema.views where table_schema = 'dummy_test'[0m
|
5098
|
+
[1m[35m (76.7ms)[0m TRUNCATE TABLE "public"."async_request_jobs" RESTART IDENTITY CASCADE;
|
5099
|
+
[1m[36m (0.1ms)[0m [1mALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "async_request_jobs" ENABLE TRIGGER ALL[0m
|
5100
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5101
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5102
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5103
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5104
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_2
|
5105
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "async_request_jobs" ("worker", "params", "status", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["worker", "Test"], ["params", "---\n- :a: a\n- 3\n- a\n"], ["status", 0], ["uid", "6d66b490-70ba-4ba6-b55a-6dfa2205812e"], ["created_at", "2018-02-07 16:48:00.278769"], ["updated_at", "2018-02-07 16:48:00.278769"]]
|
5106
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5107
|
+
[1m[36mAsyncRequest::Job Load (0.2ms)[0m [1mSELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1[0m [["uid", "6d66b490-70ba-4ba6-b55a-6dfa2205812e"]]
|
5108
|
+
[1m[35mAsyncRequest::Job Load (0.2ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."id" = $1 LIMIT 1 [["id", 1]]
|
5109
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5110
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "async_request_jobs" SET "status" = $1, "updated_at" = $2 WHERE "async_request_jobs"."id" = $3 [["status", 1], ["updated_at", "2018-02-07 16:48:00.289469"], ["id", 1]]
|
5111
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5112
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_2
|
5113
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "async_request_jobs" SET "status" = $1, "status_code" = $2, "response" = $3, "updated_at" = $4 WHERE "async_request_jobs"."id" = $5[0m [["status", 2], ["status_code", 200], ["response", "{\"status\":\"success\"}"], ["updated_at", "2018-02-07 16:48:00.292954"], ["id", 1]]
|
5114
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5115
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
5116
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
5117
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5118
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5119
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5120
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5121
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5122
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "async_request_jobs" ("worker", "params", "status", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["worker", "Test"], ["params", "---\n- :a: a\n- 3\n- a\n"], ["status", 0], ["uid", "8861bdd2-2cab-4615-9e6c-c0e9fb71aefa"], ["created_at", "2018-02-07 16:48:00.297429"], ["updated_at", "2018-02-07 16:48:00.297429"]]
|
5123
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5124
|
+
[1m[35mAsyncRequest::Job Load (0.2ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1 [["uid", "8861bdd2-2cab-4615-9e6c-c0e9fb71aefa"]]
|
5125
|
+
[1m[36mAsyncRequest::Job Load (0.2ms)[0m [1mSELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."id" = $1 LIMIT 1[0m [["id", 2]]
|
5126
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_2
|
5127
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "async_request_jobs" SET "status" = $1, "updated_at" = $2 WHERE "async_request_jobs"."id" = $3[0m [["status", 1], ["updated_at", "2018-02-07 16:48:00.300870"], ["id", 2]]
|
5128
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5129
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5130
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "async_request_jobs" SET "status" = $1, "status_code" = $2, "response" = $3, "updated_at" = $4 WHERE "async_request_jobs"."id" = $5 [["status", 2], ["status_code", 200], ["response", "{\"status\":\"success\"}"], ["updated_at", "2018-02-07 16:48:00.303286"], ["id", 2]]
|
5131
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5132
|
+
[1m[35mAsyncRequest::Job Load (0.2ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1 [["uid", "8861bdd2-2cab-4615-9e6c-c0e9fb71aefa"]]
|
5133
|
+
[1m[36m (0.3ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
5134
|
+
[1m[35m (0.3ms)[0m ROLLBACK
|
5135
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5136
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5137
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5138
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5139
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5140
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "async_request_jobs" ("worker", "params", "status", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["worker", "Test"], ["params", "---\n- :a: a\n- 3\n- a\n"], ["status", 0], ["uid", "c34496cf-909c-4e1d-9d92-365adda84841"], ["created_at", "2018-02-07 16:48:00.309013"], ["updated_at", "2018-02-07 16:48:00.309013"]]
|
5141
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5142
|
+
[1m[35mAsyncRequest::Job Load (0.2ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1 [["uid", "c34496cf-909c-4e1d-9d92-365adda84841"]]
|
5143
|
+
[1m[36mAsyncRequest::Job Load (0.2ms)[0m [1mSELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."id" = $1 LIMIT 1[0m [["id", 3]]
|
5144
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_2
|
5145
|
+
[1m[36mSQL (0.2ms)[0m [1mUPDATE "async_request_jobs" SET "status" = $1, "updated_at" = $2 WHERE "async_request_jobs"."id" = $3[0m [["status", 1], ["updated_at", "2018-02-07 16:48:00.312460"], ["id", 3]]
|
5146
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5147
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5148
|
+
[1m[35mSQL (0.2ms)[0m UPDATE "async_request_jobs" SET "status" = $1, "status_code" = $2, "response" = $3, "updated_at" = $4 WHERE "async_request_jobs"."id" = $5 [["status", 2], ["status_code", 200], ["response", "{\"status\":\"success\"}"], ["updated_at", "2018-02-07 16:48:00.314900"], ["id", 3]]
|
5149
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5150
|
+
[1m[35mAsyncRequest::Job Load (0.2ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1 [["uid", "c34496cf-909c-4e1d-9d92-365adda84841"]]
|
5151
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
5152
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
5153
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5154
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5155
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5156
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
5157
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
5158
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
5159
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5160
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5161
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5162
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5163
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5164
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "async_request_jobs" ("worker", "params", "status", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["worker", "Test"], ["params", "---\n- a\n"], ["status", 0], ["uid", "0ff16889-3d9c-48c6-9059-3330d10a83a1"], ["created_at", "2018-02-07 16:48:00.327676"], ["updated_at", "2018-02-07 16:48:00.327676"]]
|
5165
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5166
|
+
[1m[35mAsyncRequest::Job Load (0.2ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1 [["uid", "0ff16889-3d9c-48c6-9059-3330d10a83a1"]]
|
5167
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
5168
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
5169
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5170
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5171
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5172
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5173
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5174
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "async_request_jobs" ("worker", "params", "status", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["worker", "Test"], ["params", "---\n- :a: a\n- 3\n- a\n"], ["status", 0], ["uid", "68ca1309-b01f-4e8b-a932-8560293329df"], ["created_at", "2018-02-07 16:48:00.333211"], ["updated_at", "2018-02-07 16:48:00.333211"]]
|
5175
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5176
|
+
[1m[35mAsyncRequest::Job Load (0.1ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1 [["uid", "68ca1309-b01f-4e8b-a932-8560293329df"]]
|
5177
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
5178
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
5179
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5180
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5181
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5182
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5183
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5184
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "async_request_jobs" ("worker", "params", "status", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["worker", "Test"], ["params", "---\n- a\n"], ["status", 0], ["uid", "8615b999-e227-4398-8a7a-c5ad0dd57862"], ["created_at", "2018-02-07 16:48:00.338804"], ["updated_at", "2018-02-07 16:48:00.338804"]]
|
5185
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5186
|
+
[1m[35mAsyncRequest::Job Load (0.1ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1 [["uid", "8615b999-e227-4398-8a7a-c5ad0dd57862"]]
|
5187
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
5188
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
5189
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5190
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5191
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5192
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5193
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_2[0m
|
5194
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "async_request_jobs" ("worker", "params", "status", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["worker", "Test"], ["params", "---\n- a\n"], ["status", 0], ["uid", "11c2b363-5755-4d8c-8ee5-e065178fdd84"], ["created_at", "2018-02-07 16:48:00.344081"], ["updated_at", "2018-02-07 16:48:00.344081"]]
|
5195
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_2[0m
|
5196
|
+
[1m[35mAsyncRequest::Job Load (0.1ms)[0m SELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1 [["uid", "11c2b363-5755-4d8c-8ee5-e065178fdd84"]]
|
5197
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK TO SAVEPOINT active_record_1[0m
|
5198
|
+
[1m[35m (0.1ms)[0m ROLLBACK
|
5199
|
+
[1m[36m (0.1ms)[0m [1mBEGIN[0m
|
5200
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5201
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
5202
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5203
|
+
[1m[36m (0.3ms)[0m [1mSELECT COUNT(*) FROM "async_request_jobs"[0m
|
5204
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_2
|
5205
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "async_request_jobs" ("worker", "params", "status", "uid", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"[0m [["worker", "Test"], ["params", "---\n- a\n"], ["status", 0], ["uid", "56361448-5c8d-45ad-b2fb-dc420c059fdc"], ["created_at", "2018-02-07 16:48:00.351443"], ["updated_at", "2018-02-07 16:48:00.351443"]]
|
5206
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5207
|
+
[1m[36m (0.2ms)[0m [1mSELECT COUNT(*) FROM "async_request_jobs"[0m
|
5208
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
5209
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
5210
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5211
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5212
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5213
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5214
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_2
|
5215
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "async_request_jobs" ("worker", "status_code", "response", "uid", "params", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["worker", "corporis"], ["status_code", 200], ["response", "{\"a\":\"qui\",\"b\":\"incidunt\",\"c\":\"id\"}"], ["uid", "impedit"], ["params", "---\n- temporibus\n- :a: a\n"], ["status", 0], ["created_at", "2018-02-07 16:48:00.359439"], ["updated_at", "2018-02-07 16:48:00.359439"]]
|
5216
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5217
|
+
Processing by AsyncRequest::JobsController#show as HTML
|
5218
|
+
Parameters: {"id"=>"impedit"}
|
5219
|
+
[1m[36mAsyncRequest::Job Load (0.2ms)[0m [1mSELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1[0m [["uid", "impedit"]]
|
5220
|
+
Completed 202 Accepted in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
|
5221
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
5222
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
5223
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5224
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5225
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5226
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5227
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_2
|
5228
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "async_request_jobs" ("worker", "status_code", "response", "uid", "params", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["worker", "facere"], ["status_code", 200], ["response", "{\"a\":\"numquam\",\"b\":\"distinctio\",\"c\":\"enim\"}"], ["uid", "architecto"], ["params", "---\n- temporibus\n- :a: a\n"], ["status", 1], ["created_at", "2018-02-07 16:48:00.370643"], ["updated_at", "2018-02-07 16:48:00.370643"]]
|
5229
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5230
|
+
Processing by AsyncRequest::JobsController#show as HTML
|
5231
|
+
Parameters: {"id"=>"architecto"}
|
5232
|
+
[1m[36mAsyncRequest::Job Load (0.2ms)[0m [1mSELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1[0m [["uid", "architecto"]]
|
5233
|
+
Completed 202 Accepted in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
|
5234
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
5235
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
5236
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5237
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5238
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5239
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5240
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_2
|
5241
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "async_request_jobs" ("worker", "status_code", "response", "uid", "params", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["worker", "sed"], ["status_code", 200], ["response", "{\"a\":\"sint\",\"b\":\"consequatur\",\"c\":\"quos\"}"], ["uid", "ut"], ["params", "---\n- temporibus\n- :a: a\n"], ["status", 0], ["created_at", "2018-02-07 16:48:00.380251"], ["updated_at", "2018-02-07 16:48:00.380251"]]
|
5242
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5243
|
+
Processing by AsyncRequest::JobsController#show as HTML
|
5244
|
+
Parameters: {"id"=>"utABC"}
|
5245
|
+
[1m[36mAsyncRequest::Job Load (0.2ms)[0m [1mSELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1[0m [["uid", "utABC"]]
|
5246
|
+
Completed 404 Not Found in 1ms (ActiveRecord: 0.2ms)
|
5247
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
5248
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
5249
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5250
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5251
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5252
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5253
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_2
|
5254
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "async_request_jobs" ("worker", "status_code", "response", "uid", "params", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["worker", "aliquid"], ["status_code", 200], ["response", "{\"a\":\"harum\",\"b\":\"velit\",\"c\":\"earum\"}"], ["uid", "dolorem"], ["params", "---\n- temporibus\n- :a: a\n"], ["status", 2], ["created_at", "2018-02-07 16:48:00.390456"], ["updated_at", "2018-02-07 16:48:00.390456"]]
|
5255
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5256
|
+
Processing by AsyncRequest::JobsController#show as HTML
|
5257
|
+
Parameters: {"id"=>"dolorem"}
|
5258
|
+
[1m[36mAsyncRequest::Job Load (0.2ms)[0m [1mSELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1[0m [["uid", "dolorem"]]
|
5259
|
+
Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
|
5260
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
5261
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
5262
|
+
[1m[35m (0.1ms)[0m BEGIN
|
5263
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5264
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5265
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
5266
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_2
|
5267
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "async_request_jobs" ("worker", "status_code", "response", "uid", "params", "status", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"[0m [["worker", "consequatur"], ["status_code", 200], ["response", "{\"a\":\"qui\",\"b\":\"quia\",\"c\":\"repudiandae\"}"], ["uid", "alias"], ["params", "---\n- temporibus\n- :a: a\n"], ["status", 2], ["created_at", "2018-02-07 16:48:00.400272"], ["updated_at", "2018-02-07 16:48:00.400272"]]
|
5268
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_2
|
5269
|
+
Processing by AsyncRequest::JobsController#show as HTML
|
5270
|
+
Parameters: {"id"=>"alias"}
|
5271
|
+
[1m[36mAsyncRequest::Job Load (0.2ms)[0m [1mSELECT "async_request_jobs".* FROM "async_request_jobs" WHERE "async_request_jobs"."uid" = $1 LIMIT 1[0m [["uid", "alias"]]
|
5272
|
+
Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
|
5273
|
+
[1m[35m (0.1ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
5274
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
data/spec/spec_helper.rb
CHANGED
@@ -1,25 +1,24 @@
|
|
1
1
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV[
|
2
|
+
ENV['RAILS_ENV'] ||= 'test'
|
3
3
|
require 'factory_girl'
|
4
4
|
require 'faker'
|
5
5
|
require 'database_cleaner'
|
6
6
|
require 'pry'
|
7
|
-
require File.expand_path(
|
7
|
+
require File.expand_path('../dummy/config/environment', __FILE__)
|
8
8
|
require 'rspec/rails'
|
9
9
|
require 'rspec/autorun'
|
10
10
|
|
11
11
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
12
12
|
# in spec/support/ and its subdirectories.
|
13
|
-
ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
|
14
|
-
Dir[File.join(ENGINE_RAILS_ROOT,
|
13
|
+
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../')
|
14
|
+
Dir[File.join(ENGINE_RAILS_ROOT, 'spec/support/**/*.rb')].each { |f| require f }
|
15
15
|
|
16
16
|
ActiveRecord::Migration.maintain_test_schema!
|
17
17
|
|
18
|
-
require
|
18
|
+
require 'codeclimate-test-reporter'
|
19
19
|
CodeClimate::TestReporter.start
|
20
20
|
|
21
21
|
RSpec.configure do |config|
|
22
|
-
|
23
22
|
config.infer_spec_type_from_file_location!
|
24
23
|
|
25
24
|
config.include FactoryGirl::Syntax::Methods
|
@@ -64,5 +63,5 @@ RSpec.configure do |config|
|
|
64
63
|
# order dependency and want to debug it, you can fix the order by providing
|
65
64
|
# the seed, which is printed after each run.
|
66
65
|
# --seed 1234
|
67
|
-
config.order =
|
66
|
+
config.order = 'random'
|
68
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async_request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias De Santi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -247,47 +247,47 @@ specification_version: 4
|
|
247
247
|
summary: async_request gives us the possibility of handling these type of requests
|
248
248
|
in a simple way.
|
249
249
|
test_files:
|
250
|
-
- spec/
|
251
|
-
- spec/dummy/
|
252
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
253
|
-
- spec/dummy/app/controllers/application_controller.rb
|
254
|
-
- spec/dummy/app/helpers/application_helper.rb
|
255
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
256
|
-
- spec/dummy/app/workers/test.rb
|
257
|
-
- spec/dummy/bin/bundle
|
258
|
-
- spec/dummy/bin/rails
|
259
|
-
- spec/dummy/bin/rake
|
260
|
-
- spec/dummy/bin/setup
|
250
|
+
- spec/dummy/README.rdoc
|
251
|
+
- spec/dummy/Rakefile
|
261
252
|
- spec/dummy/config/application.rb
|
262
|
-
- spec/dummy/config/boot.rb
|
263
|
-
- spec/dummy/config/database.yml
|
264
253
|
- spec/dummy/config/environment.rb
|
254
|
+
- spec/dummy/config/environments/test.rb
|
265
255
|
- spec/dummy/config/environments/development.rb
|
266
256
|
- spec/dummy/config/environments/production.rb
|
267
|
-
- spec/dummy/config/environments/test.rb
|
268
|
-
- spec/dummy/config/initializers/assets.rb
|
269
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
270
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
271
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
272
|
-
- spec/dummy/config/initializers/inflections.rb
|
273
|
-
- spec/dummy/config/initializers/mime_types.rb
|
274
|
-
- spec/dummy/config/initializers/session_store.rb
|
275
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
276
257
|
- spec/dummy/config/locales/en.yml
|
277
258
|
- spec/dummy/config/routes.rb
|
259
|
+
- spec/dummy/config/database.yml
|
260
|
+
- spec/dummy/config/boot.rb
|
278
261
|
- spec/dummy/config/secrets.yml
|
279
|
-
- spec/dummy/config.
|
262
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
263
|
+
- spec/dummy/config/initializers/session_store.rb
|
264
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
265
|
+
- spec/dummy/config/initializers/inflections.rb
|
266
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
267
|
+
- spec/dummy/config/initializers/mime_types.rb
|
268
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
269
|
+
- spec/dummy/config/initializers/assets.rb
|
280
270
|
- spec/dummy/db/schema.rb
|
281
|
-
- spec/dummy/
|
271
|
+
- spec/dummy/config.ru
|
282
272
|
- spec/dummy/log/test.log
|
283
|
-
- spec/dummy/
|
284
|
-
- spec/dummy/
|
273
|
+
- spec/dummy/log/development.log
|
274
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
275
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
276
|
+
- spec/dummy/app/assets/javascripts/application.js
|
277
|
+
- spec/dummy/app/workers/test.rb
|
278
|
+
- spec/dummy/app/controllers/application_controller.rb
|
279
|
+
- spec/dummy/app/helpers/application_helper.rb
|
285
280
|
- spec/dummy/public/500.html
|
281
|
+
- spec/dummy/public/422.html
|
282
|
+
- spec/dummy/public/404.html
|
286
283
|
- spec/dummy/public/favicon.ico
|
287
|
-
- spec/dummy/
|
288
|
-
- spec/dummy/
|
289
|
-
- spec/
|
290
|
-
- spec/
|
284
|
+
- spec/dummy/bin/bundle
|
285
|
+
- spec/dummy/bin/setup
|
286
|
+
- spec/dummy/bin/rails
|
287
|
+
- spec/dummy/bin/rake
|
291
288
|
- spec/spec_helper.rb
|
292
|
-
- spec/support/parsed_response_helper.rb
|
293
289
|
- spec/workers/async_request/job_processor_spec.rb
|
290
|
+
- spec/factories/async_request_job.rb
|
291
|
+
- spec/support/parsed_response_helper.rb
|
292
|
+
- spec/controllers/async_request/jobs_controller_spec.rb
|
293
|
+
- spec/helpers/async_request/application_helper_spec.rb
|