activerecord-pg-extensions 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca67149b2f8917743b8258c14b7d2e393673093d02956a192ce40ed7857efa89
|
4
|
+
data.tar.gz: df37221b1ba08633bcb1d059ae296c4f83ec2025e6ad35eb87aaf50c7fdbaf39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60739ca5ec1d417e709792231bc06b65af4f6d2e6cac2a883a725bc5acd553d901a2d7c2d9b7da2e1a592f2f66635e740d668070a05551ffcfbefff3b4102dba
|
7
|
+
data.tar.gz: 6e34ef248fb441a9dcbdd60e4a2566e9010b01900b7802c33653e77744c9d7c9d33a65f78649118beb20bdc1fc283775232a7b834d4d514a3c8ea797d7698ee4
|
@@ -16,7 +16,7 @@ module ActiveRecord
|
|
16
16
|
|
17
17
|
@#{kind} = timeout
|
18
18
|
return unless materialized?
|
19
|
-
connection.set(#{kind.inspect}, "\#{timeout}
|
19
|
+
connection.set(#{kind.inspect}, "\#{(timeout * 1000).to_i}ms", local: true)
|
20
20
|
end
|
21
21
|
RUBY
|
22
22
|
end
|
@@ -25,7 +25,7 @@ module ActiveRecord
|
|
25
25
|
PostgreSQLAdapter::TIMEOUTS.each do |kind|
|
26
26
|
next if (timeout = send(kind, local: true)).nil?
|
27
27
|
|
28
|
-
connection.set(kind, "#{timeout}
|
28
|
+
connection.set(kind, "#{(timeout * 1000).to_i}ms", local: true)
|
29
29
|
end
|
30
30
|
super
|
31
31
|
end
|
@@ -304,7 +304,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
|
|
304
304
|
expect(connection.executed_statements).to eq(
|
305
305
|
[
|
306
306
|
"BEGIN",
|
307
|
-
"SET LOCAL statement_timeout TO '
|
307
|
+
"SET LOCAL statement_timeout TO '30000ms'",
|
308
308
|
"COMMIT"
|
309
309
|
]
|
310
310
|
)
|
@@ -315,7 +315,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
|
|
315
315
|
expect(connection.executed_statements).to eq(
|
316
316
|
[
|
317
317
|
"BEGIN",
|
318
|
-
"SET LOCAL statement_timeout TO '
|
318
|
+
"SET LOCAL statement_timeout TO '5500ms'",
|
319
319
|
"COMMIT"
|
320
320
|
]
|
321
321
|
)
|
@@ -326,7 +326,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
|
|
326
326
|
expect(connection.executed_statements).to eq(
|
327
327
|
[
|
328
328
|
"BEGIN",
|
329
|
-
"SET LOCAL statement_timeout TO '
|
329
|
+
"SET LOCAL statement_timeout TO '5000ms'",
|
330
330
|
"COMMIT"
|
331
331
|
]
|
332
332
|
)
|
@@ -337,7 +337,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
|
|
337
337
|
expect(connection.executed_statements).to eq(
|
338
338
|
[
|
339
339
|
"BEGIN",
|
340
|
-
"SET LOCAL statement_timeout TO '
|
340
|
+
"SET LOCAL statement_timeout TO '30000ms'",
|
341
341
|
"COMMIT"
|
342
342
|
]
|
343
343
|
)
|
@@ -375,7 +375,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
|
|
375
375
|
expect(connection.executed_statements).to eq(
|
376
376
|
["BEGIN",
|
377
377
|
"SELECT 1",
|
378
|
-
"SET LOCAL statement_timeout TO '
|
378
|
+
"SET LOCAL statement_timeout TO '30000ms'",
|
379
379
|
"COMMIT"]
|
380
380
|
)
|
381
381
|
end
|
@@ -390,7 +390,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
|
|
390
390
|
|
391
391
|
expect(connection.executed_statements).to eq(
|
392
392
|
["BEGIN",
|
393
|
-
"SET LOCAL statement_timeout TO '
|
393
|
+
"SET LOCAL statement_timeout TO '30000ms'",
|
394
394
|
"SELECT 1",
|
395
395
|
"COMMIT"]
|
396
396
|
)
|
@@ -410,9 +410,9 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
|
|
410
410
|
|
411
411
|
expect(connection.executed_statements).to eq(
|
412
412
|
["BEGIN",
|
413
|
-
"SET LOCAL statement_timeout TO '
|
413
|
+
"SET LOCAL statement_timeout TO '30000ms'",
|
414
414
|
"SAVEPOINT active_record_1",
|
415
|
-
"SET LOCAL statement_timeout TO '
|
415
|
+
"SET LOCAL statement_timeout TO '15000ms'",
|
416
416
|
"SELECT 1",
|
417
417
|
"RELEASE SAVEPOINT active_record_1",
|
418
418
|
"COMMIT"]
|