semian 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/semian/mysql2.rb +2 -0
- data/lib/semian/rails.rb +17 -0
- data/lib/semian/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9610bcda3bdfb95c885c6c31c4a2450a4c31824f877ad38e7ca3c34c4fd57d6c
|
4
|
+
data.tar.gz: d748c2da29ba2ca844bc74354591196a6645a915d725fea07ab743d0b6343bf2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf3e8a28916019f60f64ce668cd919e4b59e3ebcb50e397266363b7f43d093cbefd06bb41b9816351b9435484b5948eaf5c45e5408d677d76c0ac879ae98b21e
|
7
|
+
data.tar.gz: b387b82d92712aba64d47e0a8ac33abc9789dba435e88e0020de6eae46881938fcdba5f16da39cbc3930e8a8e9b4bdacf3688388c9d328be25845915b341a5ce
|
data/README.md
CHANGED
@@ -531,7 +531,7 @@ provides an easy way to get the semaphore key:
|
|
531
531
|
|
532
532
|
```
|
533
533
|
irb> require 'semian'
|
534
|
-
irb> puts Semian::Resource.new(:your_resource_name, tickets:
|
534
|
+
irb> puts Semian::Resource.new(:your_resource_name, tickets: 42).key # do this from a dev machine
|
535
535
|
"0x48af51ea"
|
536
536
|
```
|
537
537
|
|
@@ -553,8 +553,8 @@ otime = Thu Mar 30 15:06:16 2017
|
|
553
553
|
ctime = Mon Mar 13 20:25:36 2017
|
554
554
|
semnum value ncount zcount pid
|
555
555
|
0 1 0 0 48
|
556
|
-
1
|
557
|
-
2
|
556
|
+
1 42 0 0 48
|
557
|
+
2 42 0 0 27
|
558
558
|
3 31 0 0 48
|
559
559
|
```
|
560
560
|
|
data/lib/semian/mysql2.rb
CHANGED
data/lib/semian/rails.rb
CHANGED
@@ -4,6 +4,23 @@ require "active_record/connection_adapters/abstract_adapter"
|
|
4
4
|
|
5
5
|
module Semian
|
6
6
|
module Rails
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
module ClassMethods
|
10
|
+
# Translate ConnectionNotEstablished errors to their original
|
11
|
+
# cause if applicable. When we have a CircuitOpenErorr we don't
|
12
|
+
# want the Active Record error, but rather the original cause.
|
13
|
+
def new_client(config)
|
14
|
+
super
|
15
|
+
rescue ActiveRecord::ConnectionNotEstablished => e
|
16
|
+
if e.cause.is_a?(Mysql2::CircuitOpenError)
|
17
|
+
raise e.cause
|
18
|
+
else
|
19
|
+
raise
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
7
24
|
def semian_resource
|
8
25
|
@semian_resource ||= client_connection.semian_resource
|
9
26
|
end
|
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.15.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: 2022-09-
|
13
|
+
date: 2022-09-12 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
|