journaled 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/journaled/actor.rb +1 -0
- data/app/models/journaled/change.rb +1 -1
- data/app/models/journaled/change_definition.rb +1 -0
- data/app/models/journaled/change_writer.rb +1 -1
- data/app/models/journaled/delivery.rb +6 -6
- data/app/models/journaled/writer.rb +1 -1
- data/lib/journaled/version.rb +1 -1
- data/spec/dummy/log/test.log +257 -0
- data/spec/lib/journaled_spec.rb +10 -9
- data/spec/models/concerns/journaled/changes_spec.rb +1 -0
- data/spec/models/journaled/change_writer_spec.rb +21 -21
- data/spec/models/journaled/delivery_spec.rb +5 -5
- data/spec/models/journaled/event_spec.rb +1 -1
- data/spec/models/journaled/json_schema_model/validator_spec.rb +3 -3
- data/spec/models/journaled/writer_spec.rb +4 -4
- metadata +28 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f46775bfd5621ba7978529c64da7768d471ee6fd73cc8cf315d8fa60e98c537
|
4
|
+
data.tar.gz: f0bbb3d98be52d715d847a1ee44c843d8c4f654826939167a710b04a23c4adb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82c607495e4dc58e70005a73b32d473d84d85baaa4b3004d8ce018ea65d178a4eafafee7c64336ba3616dc4d6b65349bbc4d2209a770aa858cfdd92f9c07043d
|
7
|
+
data.tar.gz: 803c3f09b67ac93ff28df87ad40680f7c05daed85c7da7110c35c817ccd2cd4f2a4b1995540f5659ce5b3a839b124f4fccbeed91686f540280aa0abe25bb05c9
|
@@ -25,7 +25,7 @@ class Journaled::Delivery
|
|
25
25
|
def kinesis_client_config
|
26
26
|
{
|
27
27
|
region: ENV.fetch('AWS_DEFAULT_REGION', DEFAULT_REGION),
|
28
|
-
retry_limit: 0
|
28
|
+
retry_limit: 0,
|
29
29
|
}.merge(credentials)
|
30
30
|
end
|
31
31
|
|
@@ -37,7 +37,7 @@ class Journaled::Delivery
|
|
37
37
|
{
|
38
38
|
stream_name: stream_name,
|
39
39
|
data: serialized_event,
|
40
|
-
partition_key: partition_key
|
40
|
+
partition_key: partition_key,
|
41
41
|
}
|
42
42
|
end
|
43
43
|
|
@@ -48,7 +48,7 @@ class Journaled::Delivery
|
|
48
48
|
def credentials
|
49
49
|
if ENV.key?('JOURNALED_IAM_ROLE_ARN')
|
50
50
|
{
|
51
|
-
credentials: iam_assume_role_credentials
|
51
|
+
credentials: iam_assume_role_credentials,
|
52
52
|
}
|
53
53
|
else
|
54
54
|
legacy_credentials_hash_if_present
|
@@ -59,7 +59,7 @@ class Journaled::Delivery
|
|
59
59
|
if ENV.key?('RUBY_AWS_ACCESS_KEY_ID')
|
60
60
|
{
|
61
61
|
access_key_id: ENV.fetch('RUBY_AWS_ACCESS_KEY_ID'),
|
62
|
-
secret_access_key: ENV.fetch('RUBY_AWS_SECRET_ACCESS_KEY')
|
62
|
+
secret_access_key: ENV.fetch('RUBY_AWS_SECRET_ACCESS_KEY'),
|
63
63
|
}
|
64
64
|
else
|
65
65
|
{}
|
@@ -68,7 +68,7 @@ class Journaled::Delivery
|
|
68
68
|
|
69
69
|
def sts_client
|
70
70
|
Aws::STS::Client.new({
|
71
|
-
region: ENV.fetch('AWS_DEFAULT_REGION', DEFAULT_REGION)
|
71
|
+
region: ENV.fetch('AWS_DEFAULT_REGION', DEFAULT_REGION),
|
72
72
|
}.merge(legacy_credentials_hash_if_present))
|
73
73
|
end
|
74
74
|
|
@@ -76,7 +76,7 @@ class Journaled::Delivery
|
|
76
76
|
@iam_assume_role_credentials ||= Aws::AssumeRoleCredentials.new(
|
77
77
|
client: sts_client,
|
78
78
|
role_arn: ENV.fetch('JOURNALED_IAM_ROLE_ARN'),
|
79
|
-
role_session_name: "JournaledAssumeRoleAccess"
|
79
|
+
role_session_name: "JournaledAssumeRoleAccess",
|
80
80
|
)
|
81
81
|
end
|
82
82
|
|
data/lib/journaled/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
@@ -2223,3 +2223,260 @@
|
|
2223
2223
|
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
2224
2224
|
[1m[36m#<Class:0x00007fdb35d0d578> Update All (1.1ms)[0m [1m[33mUPDATE "delayed_jobs" SET last_error = 'locked_at'[0m
|
2225
2225
|
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2226
|
+
[1m[35m (1.5ms)[0m [1m[35mCREATE DATABASE "journaled_test" ENCODING = 'utf8'[0m
|
2227
|
+
[1m[35mSQL (0.6ms)[0m [1m[35mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
2228
|
+
[1m[35m (6.6ms)[0m [1m[35mDROP TABLE IF EXISTS "delayed_jobs" CASCADE[0m
|
2229
|
+
[1m[35m (13.5ms)[0m [1m[35mCREATE TABLE "delayed_jobs" ("id" bigserial primary key, "priority" integer DEFAULT 0 NOT NULL, "attempts" integer DEFAULT 0 NOT NULL, "handler" text NOT NULL, "last_error" text, "run_at" timestamp, "locked_at" timestamp, "failed_at" timestamp, "locked_by" character varying, "queue" character varying, "created_at" timestamp, "updated_at" timestamp)[0m
|
2230
|
+
[1m[35m (3.2ms)[0m [1m[35mCREATE INDEX "delayed_jobs_priority" ON "delayed_jobs" ("priority", "run_at")[0m
|
2231
|
+
[1m[35m (1.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
2232
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.5ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
2233
|
+
[1m[35m (0.5ms)[0m [1m[35mBEGIN[0m
|
2234
|
+
[1m[35m (0.4ms)[0m [1m[31mROLLBACK[0m
|
2235
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2236
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2237
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2238
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2239
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2240
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2241
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
2242
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2243
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2244
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2245
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2246
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2247
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2248
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2249
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2250
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2251
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2252
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2253
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2254
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2255
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2256
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2257
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2258
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2259
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2260
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2261
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2262
|
+
[1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
|
2263
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
2264
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2265
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2266
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2267
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2268
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2269
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2270
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2271
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2272
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2273
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2274
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2275
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2276
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2277
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2278
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2279
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2280
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2281
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2282
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2283
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2284
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2285
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2286
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2287
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2288
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2289
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2290
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2291
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2292
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2293
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2294
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2295
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
2296
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2297
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2298
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2299
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2300
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2301
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2302
|
+
[1m[35m (0.5ms)[0m [1m[31mROLLBACK[0m
|
2303
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
2304
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2305
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2306
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2307
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2308
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2309
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2310
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2311
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2312
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2313
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2314
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2315
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
2316
|
+
[1m[35m (0.8ms)[0m [1m[31mROLLBACK[0m
|
2317
|
+
[1m[35m (0.3ms)[0m [1m[35mBEGIN[0m
|
2318
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2319
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2320
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2321
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2322
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2323
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2324
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2325
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2326
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2327
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2328
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2329
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2330
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2331
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2332
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2333
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2334
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2335
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Create (0.7ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("priority", "handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["priority", 20], ["handler", "--- !ruby/object:Journaled::Delivery\nserialized_event: '{\"id\":\"FAKE_UUID\",\"event_type\":\"fake_event\",\"created_at\":\"2019-09-13T16:08:04.407Z\",\"foo\":\"bar\"}'\npartition_key: fake_partition_key\napp_name: my_app\n"], ["run_at", "2019-09-13 16:08:04.426521"], ["created_at", "2019-09-13 16:08:04.426575"], ["updated_at", "2019-09-13 16:08:04.426575"]]
|
2336
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2337
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Load (2.3ms)[0m [1m[37mUPDATE "delayed_jobs" SET locked_at = '2019-09-13 16:08:04.429596', locked_by = 'host:Sam-Moore-MBP13 pid:46133' WHERE id IN (SELECT "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2019-09-13 16:08:04.429073' AND (locked_at IS NULL OR locked_at < '2019-09-13 12:08:04.429082') OR locked_by = 'host:Sam-Moore-MBP13 pid:46133') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *[0m
|
2338
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2339
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Destroy (0.3ms)[0m [1m[31mDELETE FROM "delayed_jobs" WHERE "delayed_jobs"."id" = $1[0m [["id", 1]]
|
2340
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2341
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Load (0.5ms)[0m [1m[37mUPDATE "delayed_jobs" SET locked_at = '2019-09-13 16:08:04.434967', locked_by = 'host:Sam-Moore-MBP13 pid:46133' WHERE id IN (SELECT "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2019-09-13 16:08:04.434616' AND (locked_at IS NULL OR locked_at < '2019-09-13 12:08:04.434629') OR locked_by = 'host:Sam-Moore-MBP13 pid:46133') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *[0m
|
2342
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2343
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2344
|
+
[1m[35m (0.5ms)[0m [1m[34mSELECT COUNT(*) FROM "delayed_jobs" WHERE (handler like '%Journaled::Delivery%') AND "delayed_jobs"."priority" = $1[0m [["priority", 20]]
|
2345
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2346
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Create (0.2ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("priority", "handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["priority", 20], ["handler", "--- !ruby/object:Journaled::Delivery\nserialized_event: '{\"id\":\"FAKE_UUID\",\"event_type\":\"fake_event\",\"created_at\":\"2019-09-13T16:08:04.442Z\",\"foo\":\"bar\"}'\npartition_key: fake_partition_key\napp_name: my_app\n"], ["run_at", "2019-09-13 16:08:04.443861"], ["created_at", "2019-09-13 16:08:04.443892"], ["updated_at", "2019-09-13 16:08:04.443892"]]
|
2347
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2348
|
+
[1m[35m (1.0ms)[0m [1m[34mSELECT COUNT(*) FROM "delayed_jobs" WHERE (handler like '%Journaled::Delivery%') AND "delayed_jobs"."priority" = $1[0m [["priority", 20]]
|
2349
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Load (0.6ms)[0m [1m[37mUPDATE "delayed_jobs" SET locked_at = '2019-09-13 16:08:04.447239', locked_by = 'host:Sam-Moore-MBP13 pid:46133' WHERE id IN (SELECT "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2019-09-13 16:08:04.446824' AND (locked_at IS NULL OR locked_at < '2019-09-13 12:08:04.446841') OR locked_by = 'host:Sam-Moore-MBP13 pid:46133') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *[0m
|
2350
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2351
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Destroy (0.3ms)[0m [1m[31mDELETE FROM "delayed_jobs" WHERE "delayed_jobs"."id" = $1[0m [["id", 2]]
|
2352
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2353
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Load (0.5ms)[0m [1m[37mUPDATE "delayed_jobs" SET locked_at = '2019-09-13 16:08:04.450631', locked_by = 'host:Sam-Moore-MBP13 pid:46133' WHERE id IN (SELECT "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2019-09-13 16:08:04.450321' AND (locked_at IS NULL OR locked_at < '2019-09-13 12:08:04.450333') OR locked_by = 'host:Sam-Moore-MBP13 pid:46133') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *[0m
|
2354
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2355
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2356
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT COUNT(*) FROM "delayed_jobs" WHERE (handler like '%Journaled::Delivery%') AND "delayed_jobs"."priority" = $1[0m [["priority", 0]]
|
2357
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2358
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Create (0.3ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["handler", "--- !ruby/object:Journaled::Delivery\nserialized_event: '{\"id\":\"FAKE_UUID\",\"event_type\":\"fake_event\",\"created_at\":\"2019-09-13T16:08:04.454Z\",\"foo\":\"bar\"}'\npartition_key: fake_partition_key\napp_name: my_app\n"], ["run_at", "2019-09-13 16:08:04.455893"], ["created_at", "2019-09-13 16:08:04.455921"], ["updated_at", "2019-09-13 16:08:04.455921"]]
|
2359
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2360
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT COUNT(*) FROM "delayed_jobs" WHERE (handler like '%Journaled::Delivery%') AND "delayed_jobs"."priority" = $1[0m [["priority", 0]]
|
2361
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Load (0.6ms)[0m [1m[37mUPDATE "delayed_jobs" SET locked_at = '2019-09-13 16:08:04.458541', locked_by = 'host:Sam-Moore-MBP13 pid:46133' WHERE id IN (SELECT "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2019-09-13 16:08:04.458170' AND (locked_at IS NULL OR locked_at < '2019-09-13 12:08:04.458179') OR locked_by = 'host:Sam-Moore-MBP13 pid:46133') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *[0m
|
2362
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2363
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Destroy (0.2ms)[0m [1m[31mDELETE FROM "delayed_jobs" WHERE "delayed_jobs"."id" = $1[0m [["id", 3]]
|
2364
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2365
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Load (0.4ms)[0m [1m[37mUPDATE "delayed_jobs" SET locked_at = '2019-09-13 16:08:04.461295', locked_by = 'host:Sam-Moore-MBP13 pid:46133' WHERE id IN (SELECT "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2019-09-13 16:08:04.460995' AND (locked_at IS NULL OR locked_at < '2019-09-13 12:08:04.461005') OR locked_by = 'host:Sam-Moore-MBP13 pid:46133') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *[0m
|
2366
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2367
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2368
|
+
[1m[35m (0.5ms)[0m [1m[34mSELECT COUNT(*) FROM "delayed_jobs" WHERE (handler like '%Journaled::Delivery%')[0m
|
2369
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Load (0.9ms)[0m [1m[37mUPDATE "delayed_jobs" SET locked_at = '2019-09-13 16:08:04.467404', locked_by = 'host:Sam-Moore-MBP13 pid:46133' WHERE id IN (SELECT "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2019-09-13 16:08:04.466452' AND (locked_at IS NULL OR locked_at < '2019-09-13 12:08:04.466490') OR locked_by = 'host:Sam-Moore-MBP13 pid:46133') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *[0m
|
2370
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2371
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2372
|
+
[1m[35m (0.5ms)[0m [1m[34mSELECT COUNT(*) FROM "delayed_jobs" WHERE (handler like '%Journaled::Delivery%')[0m
|
2373
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Load (0.5ms)[0m [1m[37mUPDATE "delayed_jobs" SET locked_at = '2019-09-13 16:08:04.473654', locked_by = 'host:Sam-Moore-MBP13 pid:46133' WHERE id IN (SELECT "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2019-09-13 16:08:04.473318' AND (locked_at IS NULL OR locked_at < '2019-09-13 12:08:04.473330') OR locked_by = 'host:Sam-Moore-MBP13 pid:46133') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *[0m
|
2374
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2375
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2376
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2377
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2378
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2379
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2380
|
+
[1m[35m (0.3ms)[0m [1m[31mROLLBACK[0m
|
2381
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2382
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2383
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2384
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2385
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2386
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2387
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2388
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2389
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2390
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2391
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2392
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2393
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2394
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2395
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2396
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2397
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2398
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2399
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2400
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2401
|
+
[1m[36m#<Class:0x00007f984dfb7a60> Create (0.3ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["handler", "--- !ruby/module 'TestJob'\n"], ["run_at", "2019-09-13 16:08:04.529164"], ["created_at", "2019-09-13 16:08:04.529206"], ["updated_at", "2019-09-13 16:08:04.529206"]]
|
2402
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2403
|
+
[1m[36m#<Class:0x00007f984dfb7a60> Destroy (0.6ms)[0m [1m[31mDELETE FROM "delayed_jobs" WHERE "delayed_jobs"."id" = $1[0m [["id", 4]]
|
2404
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2405
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2406
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2407
|
+
[1m[36m#<Class:0x00007f984ebea080> Create (0.3ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["handler", "--- !ruby/module 'TestJob'\n"], ["run_at", "2019-09-13 16:08:04.555858"], ["created_at", "2019-09-13 16:08:04.555895"], ["updated_at", "2019-09-13 16:08:04.555895"]]
|
2408
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Create (0.4ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("priority", "handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["priority", 20], ["handler", "--- !ruby/object:Journaled::Delivery\nserialized_event: '{\"id\":\"3277d88b-04bf-43fa-9a87-84919973801e\",\"event_type\":\"journaled_change\",\"created_at\":\"2019-09-13T16:08:04.558Z\",\"table_name\":\"delayed_jobs\",\"record_id\":\"5\",\"database_operation\":\"create\",\"logical_operation\":\"attempt\",\"changes\":\"{\\\"locked_at\\\":null}\",\"actor\":\"gid://dummy\"}'\npartition_key: journaled_change\napp_name: \n"], ["run_at", "2019-09-13 16:08:04.562411"], ["created_at", "2019-09-13 16:08:04.562444"], ["updated_at", "2019-09-13 16:08:04.562444"]]
|
2409
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2410
|
+
[1m[36m#<Class:0x00007f984ebea080> Destroy (0.4ms)[0m [1m[31mDELETE FROM "delayed_jobs" WHERE "delayed_jobs"."id" = $1[0m [["id", 5]]
|
2411
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2412
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2413
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2414
|
+
[1m[36m#<Class:0x00007f984e57c590> Create (0.3ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["handler", "--- !ruby/module 'TestJob'\n"], ["run_at", "2019-09-13 16:08:04.579633"], ["created_at", "2019-09-13 16:08:04.579688"], ["updated_at", "2019-09-13 16:08:04.579688"]]
|
2415
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Create (0.4ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("priority", "handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["priority", 20], ["handler", "--- !ruby/object:Journaled::Delivery\nserialized_event: '{\"id\":\"b9b84453-7493-4e7a-aed4-c26a0240f95f\",\"event_type\":\"journaled_change\",\"created_at\":\"2019-09-13T16:08:04.583Z\",\"table_name\":\"delayed_jobs\",\"record_id\":\"7\",\"database_operation\":\"create\",\"logical_operation\":\"attempt\",\"changes\":\"{\\\"locked_at\\\":null}\",\"actor\":\"gid://dummy\"}'\npartition_key: journaled_change\napp_name: \n"], ["run_at", "2019-09-13 16:08:04.585117"], ["created_at", "2019-09-13 16:08:04.585152"], ["updated_at", "2019-09-13 16:08:04.585152"]]
|
2416
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2417
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2418
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2419
|
+
[1m[35m (0.3ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2420
|
+
[1m[36m#<Class:0x00007f984e587580> Create (0.3ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["handler", "--- !ruby/module 'TestJob'\n"], ["run_at", "2019-09-13 16:08:04.598271"], ["created_at", "2019-09-13 16:08:04.598310"], ["updated_at", "2019-09-13 16:08:04.598310"]]
|
2421
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Create (0.4ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("priority", "handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["priority", 20], ["handler", "--- !ruby/object:Journaled::Delivery\nserialized_event: '{\"id\":\"53d8c08d-077d-4892-a225-3a3fd1e1fc75\",\"event_type\":\"journaled_change\",\"created_at\":\"2019-09-13T16:08:04.602Z\",\"table_name\":\"delayed_jobs\",\"record_id\":\"9\",\"database_operation\":\"create\",\"logical_operation\":\"attempt\",\"changes\":\"{\\\"locked_at\\\":null}\",\"actor\":\"gid://dummy\"}'\npartition_key: journaled_change\napp_name: \n"], ["run_at", "2019-09-13 16:08:04.623125"], ["created_at", "2019-09-13 16:08:04.623162"], ["updated_at", "2019-09-13 16:08:04.623162"]]
|
2422
|
+
[1m[35m (0.2ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2423
|
+
[1m[36m#<Class:0x00007f984e587580> Update (0.3ms)[0m [1m[33mUPDATE "delayed_jobs" SET "locked_at" = $1 WHERE "delayed_jobs"."id" = $2[0m [["locked_at", nil], ["id", 9]]
|
2424
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2425
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2426
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2427
|
+
[1m[36m#<Class:0x00007f984e35d2c8> Create (0.3ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["handler", "--- !ruby/module 'TestJob'\n"], ["run_at", "2019-09-13 16:08:04.638487"], ["created_at", "2019-09-13 16:08:04.638522"], ["updated_at", "2019-09-13 16:08:04.638522"]]
|
2428
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Create (0.3ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("priority", "handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["priority", 20], ["handler", "--- !ruby/object:Journaled::Delivery\nserialized_event: '{\"id\":\"9e974ebc-7f48-438e-a743-00fafe6fff16\",\"event_type\":\"journaled_change\",\"created_at\":\"2019-09-13T16:08:04.640Z\",\"table_name\":\"delayed_jobs\",\"record_id\":\"11\",\"database_operation\":\"create\",\"logical_operation\":\"attempt\",\"changes\":\"{\\\"locked_at\\\":null}\",\"actor\":\"gid://dummy\"}'\npartition_key: journaled_change\napp_name: \n"], ["run_at", "2019-09-13 16:08:04.642295"], ["created_at", "2019-09-13 16:08:04.642319"], ["updated_at", "2019-09-13 16:08:04.642319"]]
|
2429
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2430
|
+
[1m[36m#<Class:0x00007f984e35d2c8> Update (0.3ms)[0m [1m[33mUPDATE "delayed_jobs" SET "handler" = $1 WHERE "delayed_jobs"."id" = $2[0m [["handler", ""], ["id", 11]]
|
2431
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2432
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2433
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
2434
|
+
[1m[36m#<Class:0x00007f984dd0b0f0> Create (0.2ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"[0m [["handler", "--- !ruby/module 'TestJob'\n"], ["run_at", "2019-09-13 16:08:04.656927"], ["created_at", "2019-09-13 16:08:04.656963"], ["updated_at", "2019-09-13 16:08:04.656963"]]
|
2435
|
+
[1m[36mDelayed::Backend::ActiveRecord::Job Create (0.3ms)[0m [1m[32mINSERT INTO "delayed_jobs" ("priority", "handler", "run_at", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"[0m [["priority", 20], ["handler", "--- !ruby/object:Journaled::Delivery\nserialized_event: '{\"id\":\"6280fd1a-693f-4929-8357-5a01ed7c70c2\",\"event_type\":\"journaled_change\",\"created_at\":\"2019-09-13T16:08:04.659Z\",\"table_name\":\"delayed_jobs\",\"record_id\":\"13\",\"database_operation\":\"create\",\"logical_operation\":\"attempt\",\"changes\":\"{\\\"locked_at\\\":null}\",\"actor\":\"gid://dummy\"}'\npartition_key: journaled_change\napp_name: \n"], ["run_at", "2019-09-13 16:08:04.660811"], ["created_at", "2019-09-13 16:08:04.660834"], ["updated_at", "2019-09-13 16:08:04.660834"]]
|
2436
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
2437
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2438
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2439
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2440
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2441
|
+
[1m[36m#<Class:0x00007f9851168f28> Update All (0.4ms)[0m [1m[33mUPDATE "delayed_jobs" SET "locked_at" = $1[0m [["locked_at", nil]]
|
2442
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2443
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2444
|
+
[1m[36m#<Class:0x00007f984de0c490> Update All (0.3ms)[0m [1m[33mUPDATE "delayed_jobs" SET last_error = 'locked_at'[0m
|
2445
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2446
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2447
|
+
[1m[36m#<Class:0x00007f98511a00b8> Update All (0.3ms)[0m [1m[33mUPDATE "delayed_jobs" SET "handler" = $1[0m [["handler", ""]]
|
2448
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2449
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2450
|
+
[1m[36m#<Class:0x00007f98511f22a0> Destroy (0.3ms)[0m [1m[31mDELETE FROM "delayed_jobs"[0m
|
2451
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2452
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2453
|
+
[1m[36m#<Class:0x00007f985122a358> Destroy (0.3ms)[0m [1m[31mDELETE FROM "delayed_jobs"[0m
|
2454
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2455
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2456
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2457
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
2458
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2459
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2460
|
+
[1m[36m#<Class:0x00007f985127abf0> Destroy (0.4ms)[0m [1m[31mDELETE FROM "delayed_jobs" WHERE "delayed_jobs"."id" = $1[0m [["id", 1]]
|
2461
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2462
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2463
|
+
[1m[36m#<Class:0x00007f98512a5bc0> Destroy (0.3ms)[0m [1m[31mDELETE FROM "delayed_jobs" WHERE "delayed_jobs"."id" = $1[0m [["id", 1]]
|
2464
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2465
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2466
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2467
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2468
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2469
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2470
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2471
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2472
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2473
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2474
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2475
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2476
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2477
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2478
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
2479
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2480
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
2481
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
2482
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
data/spec/lib/journaled_spec.rb
CHANGED
@@ -3,49 +3,50 @@ require 'rails_helper'
|
|
3
3
|
RSpec.describe Journaled do
|
4
4
|
it "is enabled in production" do
|
5
5
|
allow(Rails).to receive(:env).and_return("production")
|
6
|
-
expect(
|
6
|
+
expect(described_class).to be_enabled
|
7
7
|
end
|
8
8
|
|
9
9
|
it "is disabled in development" do
|
10
10
|
allow(Rails).to receive(:env).and_return("development")
|
11
|
-
expect(
|
11
|
+
expect(described_class).not_to be_enabled
|
12
12
|
end
|
13
13
|
|
14
14
|
it "is disabled in test" do
|
15
15
|
allow(Rails).to receive(:env).and_return("test")
|
16
|
-
expect(
|
16
|
+
expect(described_class).not_to be_enabled
|
17
17
|
end
|
18
18
|
|
19
19
|
it "is enabled in whatevs" do
|
20
20
|
allow(Rails).to receive(:env).and_return("whatevs")
|
21
|
-
expect(
|
21
|
+
expect(described_class).to be_enabled
|
22
22
|
end
|
23
23
|
|
24
24
|
it "is enabled when explicitly enabled in development" do
|
25
25
|
with_env(JOURNALED_ENABLED: true) do
|
26
26
|
allow(Rails).to receive(:env).and_return("development")
|
27
|
-
expect(
|
27
|
+
expect(described_class).to be_enabled
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
it "is disabled when explicitly disabled in production" do
|
32
32
|
with_env(JOURNALED_ENABLED: false) do
|
33
33
|
allow(Rails).to receive(:env).and_return("production")
|
34
|
-
expect(
|
34
|
+
expect(described_class).not_to be_enabled
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
it "is disabled when explicitly disabled with empty string" do
|
39
39
|
with_env(JOURNALED_ENABLED: '') do
|
40
40
|
allow(Rails).to receive(:env).and_return("production")
|
41
|
-
expect(
|
41
|
+
expect(described_class).not_to be_enabled
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
describe "#actor_uri" do
|
46
46
|
it "delegates to ActorUriProvider" do
|
47
|
-
allow(Journaled::ActorUriProvider).to receive(:instance)
|
48
|
-
|
47
|
+
allow(Journaled::ActorUriProvider).to receive(:instance)
|
48
|
+
.and_return(instance_double(Journaled::ActorUriProvider, actor_uri: "my actor uri"))
|
49
|
+
expect(described_class.actor_uri).to eq "my actor uri"
|
49
50
|
end
|
50
51
|
end
|
51
52
|
end
|
@@ -17,6 +17,7 @@ RSpec.describe Journaled::Changes do
|
|
17
17
|
def self.after_save(opts, &hook)
|
18
18
|
# This is a back-door assertion to prevent regressions in the module's hook definition behavior
|
19
19
|
raise "expected `unless: :saved_change_to_id?`" unless opts[:unless] == :saved_change_to_id?
|
20
|
+
|
20
21
|
after_save_hooks << hook
|
21
22
|
end
|
22
23
|
|
@@ -11,12 +11,12 @@ RSpec.describe Journaled::ChangeWriter do
|
|
11
11
|
"name" => "bob",
|
12
12
|
"rank" => "first lieutenant",
|
13
13
|
"serial_number" => "foobar",
|
14
|
-
"last_sign_in_at" => now
|
14
|
+
"last_sign_in_at" => now,
|
15
15
|
},
|
16
16
|
saved_changes: {
|
17
17
|
"name" => %w(bill bob),
|
18
|
-
"last_sign_in_at" => now
|
19
|
-
}
|
18
|
+
"last_sign_in_at" => now,
|
19
|
+
},
|
20
20
|
)
|
21
21
|
end
|
22
22
|
|
@@ -24,21 +24,21 @@ RSpec.describe Journaled::ChangeWriter do
|
|
24
24
|
double(
|
25
25
|
"SoldierClass",
|
26
26
|
table_name: "soldiers",
|
27
|
-
attribute_names: %w(id name rank serial_number last_sign_in_at)
|
27
|
+
attribute_names: %w(id name rank serial_number last_sign_in_at),
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
31
31
|
let(:change_definition) do
|
32
32
|
Journaled::ChangeDefinition.new(
|
33
33
|
attribute_names: %i(name rank serial_number),
|
34
|
-
logical_operation: "identity_change"
|
34
|
+
logical_operation: "identity_change",
|
35
35
|
)
|
36
36
|
end
|
37
37
|
|
38
38
|
let(:faulty_change_definition) do
|
39
39
|
Journaled::ChangeDefinition.new(
|
40
40
|
attribute_names: %i(name rank serial_number nonexistent_thingie),
|
41
|
-
logical_operation: "identity_change"
|
41
|
+
logical_operation: "identity_change",
|
42
42
|
)
|
43
43
|
end
|
44
44
|
|
@@ -58,9 +58,9 @@ RSpec.describe Journaled::ChangeWriter do
|
|
58
58
|
"name" => "bill",
|
59
59
|
"rank" => "first lieutenant",
|
60
60
|
"serial_number" => "foobar",
|
61
|
-
"last_sign_in_at" => Time.zone.now
|
61
|
+
"last_sign_in_at" => Time.zone.now,
|
62
62
|
},
|
63
|
-
saved_changes: {}
|
63
|
+
saved_changes: {},
|
64
64
|
)
|
65
65
|
end
|
66
66
|
|
@@ -68,7 +68,7 @@ RSpec.describe Journaled::ChangeWriter do
|
|
68
68
|
expect(subject.relevant_attributes).to eq(
|
69
69
|
"name" => "bill",
|
70
70
|
"rank" => "first lieutenant",
|
71
|
-
"serial_number" => "foobar"
|
71
|
+
"serial_number" => "foobar",
|
72
72
|
)
|
73
73
|
end
|
74
74
|
end
|
@@ -83,11 +83,11 @@ RSpec.describe Journaled::ChangeWriter do
|
|
83
83
|
"name" => "bill",
|
84
84
|
"rank" => "first lieutenant",
|
85
85
|
"serial_number" => "foobar",
|
86
|
-
"last_sign_in_at" => Time.zone.now
|
86
|
+
"last_sign_in_at" => Time.zone.now,
|
87
87
|
},
|
88
88
|
changes: {
|
89
|
-
"name" => %w(bob bill)
|
90
|
-
}
|
89
|
+
"name" => %w(bob bill),
|
90
|
+
},
|
91
91
|
)
|
92
92
|
end
|
93
93
|
|
@@ -95,7 +95,7 @@ RSpec.describe Journaled::ChangeWriter do
|
|
95
95
|
expect(subject.relevant_unperturbed_attributes).to eq(
|
96
96
|
"name" => "bob",
|
97
97
|
"rank" => "first lieutenant",
|
98
|
-
"serial_number" => "foobar"
|
98
|
+
"serial_number" => "foobar",
|
99
99
|
)
|
100
100
|
end
|
101
101
|
end
|
@@ -180,9 +180,9 @@ RSpec.describe Journaled::ChangeWriter do
|
|
180
180
|
"name" => "bill",
|
181
181
|
"rank" => "first lieutenant",
|
182
182
|
"serial_number" => "foobar",
|
183
|
-
"last_sign_in_at" => Time.zone.now
|
183
|
+
"last_sign_in_at" => Time.zone.now,
|
184
184
|
},
|
185
|
-
saved_changes: {}
|
185
|
+
saved_changes: {},
|
186
186
|
)
|
187
187
|
end
|
188
188
|
|
@@ -222,9 +222,9 @@ RSpec.describe Journaled::ChangeWriter do
|
|
222
222
|
"name" => "bill",
|
223
223
|
"rank" => "first lieutenant",
|
224
224
|
"serial_number" => "foobar",
|
225
|
-
"last_sign_in_at" => Time.zone.now
|
225
|
+
"last_sign_in_at" => Time.zone.now,
|
226
226
|
},
|
227
|
-
saved_changes: {}
|
227
|
+
saved_changes: {},
|
228
228
|
)
|
229
229
|
end
|
230
230
|
|
@@ -248,11 +248,11 @@ RSpec.describe Journaled::ChangeWriter do
|
|
248
248
|
"name" => "bob",
|
249
249
|
"rank" => "first lieutenant",
|
250
250
|
"serial_number" => "foobar",
|
251
|
-
"last_sign_in_at" => now
|
251
|
+
"last_sign_in_at" => now,
|
252
252
|
},
|
253
253
|
changes: {
|
254
|
-
"name" => %w(bill bob)
|
255
|
-
}
|
254
|
+
"name" => %w(bill bob),
|
255
|
+
},
|
256
256
|
)
|
257
257
|
end
|
258
258
|
|
@@ -261,7 +261,7 @@ RSpec.describe Journaled::ChangeWriter do
|
|
261
261
|
expect(JSON.parse(opts[:changes])).to eq(
|
262
262
|
"name" => "bill",
|
263
263
|
"rank" => "first lieutenant",
|
264
|
-
"serial_number" => "foobar"
|
264
|
+
"serial_number" => "foobar",
|
265
265
|
)
|
266
266
|
journaled_change
|
267
267
|
end
|
@@ -47,14 +47,14 @@ RSpec.describe Journaled::Delivery do
|
|
47
47
|
{
|
48
48
|
assumed_role_user: {
|
49
49
|
arn: 'iam-role-arn-for-assuming-kinesis-access',
|
50
|
-
assumed_role_id: "ARO123EXAMPLE123:Bob"
|
50
|
+
assumed_role_id: "ARO123EXAMPLE123:Bob",
|
51
51
|
},
|
52
52
|
credentials: {
|
53
53
|
access_key_id: "AKIAIOSFODNN7EXAMPLE",
|
54
54
|
secret_access_key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
|
55
55
|
session_token: "EXAMPLEtc764bNrC9SAPBSM22wDOk4x4HIZ8j4FZTwdQWLWsKWHGBuFqwAeMicRXmxfpSPfIeoIYRqTflfKD8YUuwthAx7mSEI",
|
56
|
-
expiration: Time.zone.parse("2011-07-15T23:28:33.359Z")
|
57
|
-
}
|
56
|
+
expiration: Time.zone.parse("2011-07-15T23:28:33.359Z"),
|
57
|
+
},
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
@@ -64,7 +64,7 @@ RSpec.describe Journaled::Delivery do
|
|
64
64
|
expect(Aws::AssumeRoleCredentials).to have_received(:new).with(
|
65
65
|
client: aws_sts_client,
|
66
66
|
role_arn: "iam-role-arn-for-assuming-kinesis-access",
|
67
|
-
role_session_name: "JournaledAssumeRoleAccess"
|
67
|
+
role_session_name: "JournaledAssumeRoleAccess",
|
68
68
|
)
|
69
69
|
end
|
70
70
|
end
|
@@ -127,7 +127,7 @@ RSpec.describe Journaled::Delivery do
|
|
127
127
|
|
128
128
|
it 'catches the error and re-raises a subclass of NotTrulyExceptionalError and logs about the failure' do
|
129
129
|
expect(Rails.logger).to receive(:error).with(
|
130
|
-
"Kinesis Error - Networking Error occurred - Seahorse::Client::NetworkingError"
|
130
|
+
"Kinesis Error - Networking Error occurred - Seahorse::Client::NetworkingError",
|
131
131
|
).once
|
132
132
|
expect { subject.perform }.to raise_error described_class::KinesisTemporaryFailure
|
133
133
|
end
|
@@ -12,7 +12,7 @@ RSpec.describe Journaled::JsonSchemaModel::Validator do
|
|
12
12
|
some_time: Time.zone.parse('2017-01-20 15:16:17 -05:00'),
|
13
13
|
some_int: some_int_value,
|
14
14
|
some_optional_string: some_optional_string_value,
|
15
|
-
some_nullable_field: some_nullable_field
|
15
|
+
some_nullable_field: some_nullable_field,
|
16
16
|
}
|
17
17
|
end
|
18
18
|
let(:some_int_value) { 3 }
|
@@ -77,7 +77,7 @@ RSpec.describe Journaled::JsonSchemaModel::Validator do
|
|
77
77
|
some_decimal: 0.1.to_d,
|
78
78
|
some_time: Time.zone.parse('2017-01-20 15:16:17 -05:00'),
|
79
79
|
some_int: some_int_value,
|
80
|
-
some_nullable_field: some_nullable_field
|
80
|
+
some_nullable_field: some_nullable_field,
|
81
81
|
}
|
82
82
|
end
|
83
83
|
|
@@ -108,7 +108,7 @@ RSpec.describe Journaled::JsonSchemaModel::Validator do
|
|
108
108
|
{
|
109
109
|
some_string: some_string_value,
|
110
110
|
some_decimal: 0.1.to_d,
|
111
|
-
some_time: Time.zone.parse('2017-01-20 15:16:17 -05:00')
|
111
|
+
some_time: Time.zone.parse('2017-01-20 15:16:17 -05:00'),
|
112
112
|
}
|
113
113
|
end
|
114
114
|
|
@@ -18,7 +18,7 @@ RSpec.describe Journaled::Writer do
|
|
18
18
|
journaled_schema_name: nil,
|
19
19
|
journaled_attributes: {},
|
20
20
|
journaled_partition_key: '',
|
21
|
-
journaled_app_name: nil
|
21
|
+
journaled_app_name: nil,
|
22
22
|
)
|
23
23
|
end
|
24
24
|
|
@@ -33,12 +33,12 @@ RSpec.describe Journaled::Writer do
|
|
33
33
|
journaled_schema_name: :fake_schema_name,
|
34
34
|
journaled_attributes: { foo: :bar },
|
35
35
|
journaled_partition_key: 'fake_partition_key',
|
36
|
-
journaled_app_name: nil
|
36
|
+
journaled_app_name: nil,
|
37
37
|
)
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'does not raise on initialization' do
|
41
|
-
expect { subject }.
|
41
|
+
expect { subject }.not_to raise_error
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -72,7 +72,7 @@ RSpec.describe Journaled::Writer do
|
|
72
72
|
journaled_schema_name: :fake_schema_name,
|
73
73
|
journaled_attributes: journaled_event_attributes,
|
74
74
|
journaled_partition_key: 'fake_partition_key',
|
75
|
-
journaled_app_name: 'my_app'
|
75
|
+
journaled_app_name: 'my_app',
|
76
76
|
)
|
77
77
|
end
|
78
78
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: journaled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Lipson
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-09-
|
14
|
+
date: 2019-09-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: aws-sdk-resources
|
@@ -59,16 +59,22 @@ dependencies:
|
|
59
59
|
name: rails
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
|
-
- - "
|
62
|
+
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '5.1'
|
65
|
+
- - "<"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '7.0'
|
65
68
|
type: :runtime
|
66
69
|
prerelease: false
|
67
70
|
version_requirements: !ruby/object:Gem::Requirement
|
68
71
|
requirements:
|
69
|
-
- - "
|
72
|
+
- - ">="
|
70
73
|
- !ruby/object:Gem::Version
|
71
74
|
version: '5.1'
|
75
|
+
- - "<"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '7.0'
|
72
78
|
- !ruby/object:Gem::Dependency
|
73
79
|
name: request_store
|
74
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,6 +89,20 @@ dependencies:
|
|
83
89
|
- - ">="
|
84
90
|
- !ruby/object:Gem::Version
|
85
91
|
version: '0'
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: appraisal
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - "~>"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 2.2.0
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 2.2.0
|
86
106
|
- !ruby/object:Gem::Dependency
|
87
107
|
name: delayed_job_active_record
|
88
108
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,16 +177,16 @@ dependencies:
|
|
157
177
|
name: rubocop-betterment
|
158
178
|
requirement: !ruby/object:Gem::Requirement
|
159
179
|
requirements:
|
160
|
-
- -
|
180
|
+
- - "~>"
|
161
181
|
- !ruby/object:Gem::Version
|
162
|
-
version: 1.3
|
182
|
+
version: '1.3'
|
163
183
|
type: :development
|
164
184
|
prerelease: false
|
165
185
|
version_requirements: !ruby/object:Gem::Requirement
|
166
186
|
requirements:
|
167
|
-
- -
|
187
|
+
- - "~>"
|
168
188
|
- !ruby/object:Gem::Version
|
169
|
-
version: 1.3
|
189
|
+
version: '1.3'
|
170
190
|
- !ruby/object:Gem::Dependency
|
171
191
|
name: spring
|
172
192
|
requirement: !ruby/object:Gem::Requirement
|