semian 0.19.1 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/semian/extconf.rb +2 -0
- data/ext/semian/resource.c +1 -7
- data/lib/semian/activerecord_trilogy_adapter.rb +6 -12
- data/lib/semian/mysql2.rb +2 -2
- data/lib/semian/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd8decd384592d21ffffd5d5300099c9bf7a0971e7a385fb84288bd2661fa165
|
4
|
+
data.tar.gz: 3cd2627d985a29ab04a8b28f27bd0f12756f182a6919b86f5ae1821751f3ccf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f14a28ea47bf2ffd290ae0d01535361a5a13e3f85debcad18c0801c367a13dc3bbc0e23280bf339c9c9cd098ec7a0d03eaf3c853d11c57911d2fe561750112f2
|
7
|
+
data.tar.gz: fbde9d094a74317531b55df4075b63b9cc69337a44fdf6212f8ca2c350c2d2084b3b6a8b4cc0762b70ae4ac574fbd0b0c13decd378f191394b07fb6553fb0293
|
data/ext/semian/extconf.rb
CHANGED
data/ext/semian/resource.c
CHANGED
@@ -359,12 +359,6 @@ ms_to_timespec(long ms, struct timespec *ts)
|
|
359
359
|
ts->tv_nsec = (ms % 1000) * 1000000;
|
360
360
|
}
|
361
361
|
|
362
|
-
static void
|
363
|
-
semian_resource_mark(void *ptr)
|
364
|
-
{
|
365
|
-
/* noop */
|
366
|
-
}
|
367
|
-
|
368
362
|
static void
|
369
363
|
semian_resource_free(void *ptr)
|
370
364
|
{
|
@@ -386,7 +380,7 @@ static const rb_data_type_t
|
|
386
380
|
semian_resource_type = {
|
387
381
|
"semian_resource",
|
388
382
|
{
|
389
|
-
|
383
|
+
NULL,
|
390
384
|
semian_resource_free,
|
391
385
|
semian_resource_memsize
|
392
386
|
},
|
@@ -9,7 +9,7 @@ module ActiveRecord
|
|
9
9
|
class TrilogyAdapter
|
10
10
|
ActiveRecord::ActiveRecordError.include(::Semian::AdapterError)
|
11
11
|
|
12
|
-
class SemianError <
|
12
|
+
class SemianError < ConnectionNotEstablished
|
13
13
|
def initialize(semian_identifier, *args)
|
14
14
|
super(*args)
|
15
15
|
@semian_identifier = semian_identifier
|
@@ -82,18 +82,12 @@ module Semian
|
|
82
82
|
|
83
83
|
private
|
84
84
|
|
85
|
-
def acquire_semian_resource(**)
|
86
|
-
super
|
87
|
-
rescue ActiveRecord::StatementInvalid => error
|
88
|
-
if error.cause.is_a?(Trilogy::TimeoutError)
|
89
|
-
semian_resource.mark_failed(error)
|
90
|
-
error.semian_identifier = semian_identifier
|
91
|
-
end
|
92
|
-
raise
|
93
|
-
end
|
94
|
-
|
95
85
|
def resource_exceptions
|
96
|
-
[
|
86
|
+
[
|
87
|
+
ActiveRecord::AdapterTimeout,
|
88
|
+
ActiveRecord::ConnectionFailed,
|
89
|
+
ActiveRecord::ConnectionNotEstablished,
|
90
|
+
]
|
97
91
|
end
|
98
92
|
|
99
93
|
# TODO: share this with Mysql2
|
data/lib/semian/mysql2.rb
CHANGED
@@ -22,8 +22,8 @@ module Semian
|
|
22
22
|
include Semian::Adapter
|
23
23
|
|
24
24
|
CONNECTION_ERROR = Regexp.union(
|
25
|
-
/Can't connect to MySQL server on/i,
|
26
|
-
/Lost connection to MySQL server/i,
|
25
|
+
/Can't connect to (?:MySQL )?server on/i,
|
26
|
+
/Lost connection to (?:MySQL )?server/i,
|
27
27
|
/MySQL server has gone away/i,
|
28
28
|
/Too many connections/i,
|
29
29
|
/closed MySQL connection/i,
|
data/lib/semian/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Francis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: |2
|
16
16
|
A Ruby C extention that is used to control access to shared resources
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
|
-
rubygems_version: 3.4.
|
82
|
+
rubygems_version: 3.4.21
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Bulkheading for Ruby with SysV semaphores
|