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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6bae2b0df6fceb44b91a57900ba40be6b53588866025c269627b08c2ccfa193
4
- data.tar.gz: f11b8fb67e10cfbb5f1fe393225a45ba0836324768e5fa01366f760151b635b3
3
+ metadata.gz: bd8decd384592d21ffffd5d5300099c9bf7a0971e7a385fb84288bd2661fa165
4
+ data.tar.gz: 3cd2627d985a29ab04a8b28f27bd0f12756f182a6919b86f5ae1821751f3ccf5
5
5
  SHA512:
6
- metadata.gz: b39cc0bfcf4341bd0a008f50109abb77f27b75021c28245d4c8e4b2af3bb78ca4611deef872c3b40714d4047a8ede6bcfc88cd426a8866f2e51249f3606aefb4
7
- data.tar.gz: 89829e6fb002b9d96c2b96ede7339e10e7d3e1c6fee8d8d023b831747e969622d08342e07d7e0cd7ce31f433239e984b881417140e15a9a736501a62c941c79b
6
+ metadata.gz: f14a28ea47bf2ffd290ae0d01535361a5a13e3f85debcad18c0801c367a13dc3bbc0e23280bf339c9c9cd098ec7a0d03eaf3c853d11c57911d2fe561750112f2
7
+ data.tar.gz: fbde9d094a74317531b55df4075b63b9cc69337a44fdf6212f8ca2c350c2d2084b3b6a8b4cc0762b70ae4ac574fbd0b0c13decd378f191394b07fb6553fb0293
@@ -15,6 +15,8 @@ end
15
15
 
16
16
  require "mkmf"
17
17
 
18
+ dir_config("openssl")
19
+
18
20
  abort "openssl is missing. please install openssl." unless find_header("openssl/sha.h")
19
21
  abort "openssl is missing. please install openssl." unless find_library("crypto", "SHA1")
20
22
 
@@ -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
- semian_resource_mark,
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 < StatementInvalid
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
- [ActiveRecord::ConnectionNotEstablished]
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Semian
4
- VERSION = "0.19.1"
4
+ VERSION = "0.20.0"
5
5
  end
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.19.1
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-05-16 00:00:00.000000000 Z
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.13
82
+ rubygems_version: 3.4.21
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Bulkheading for Ruby with SysV semaphores