opener-daemons 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opener/daemons/version.rb +1 -1
- data/lib/opener/daemons/worker.rb +49 -3
- data/opener-daemons.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 081edcf7e60af228857624b50af9619ff3fb0118
|
4
|
+
data.tar.gz: 4bb69b101678efd7b05bfe222a92fd211c13db59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f709e600af06649e4e631456a313750d976fbf5fdebbf2b33ae7bfd52e24a3e4d118595892b3dc9277a6880cf0438f1f042e37c9a22948cf9be695c8abff459
|
7
|
+
data.tar.gz: 4e52fac8c46818eff00f1a9b3a5cba0b37a6aeb807c71a30dd93b150f2acf630567a61cfa4cd9a3c11f8ef4bb47702ab582aef0952bb85503921ad95af170029
|
@@ -41,8 +41,35 @@ module Opener
|
|
41
41
|
def process
|
42
42
|
add_transaction_attributes
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
begin
|
45
|
+
output = run_component
|
46
|
+
object = upload_output(output)
|
47
|
+
|
48
|
+
submit_callbacks(object)
|
49
|
+
|
50
|
+
# Unsupported languages are handled in a different manner as they can
|
51
|
+
# occur quite often. In these cases we _do_ want the data to be sent
|
52
|
+
# to the final callback URL (skipping whatever comes before it) so it
|
53
|
+
# can act upon it.
|
54
|
+
rescue Core::UnsupportedLanguageError
|
55
|
+
handle_unsupported_language
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# @return [String]
|
61
|
+
#
|
62
|
+
def run_component
|
63
|
+
input = downloader.download(config.input_url)
|
64
|
+
|
65
|
+
return config.component_instance.run(input)
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# @param [String] output
|
70
|
+
# @return [AWS::S3::S3Object]
|
71
|
+
#
|
72
|
+
def upload_output(output)
|
46
73
|
object = uploader.upload(config.identifier, output, config.metadata)
|
47
74
|
|
48
75
|
Core::Syslog.info(
|
@@ -50,7 +77,7 @@ module Opener
|
|
50
77
|
config.metadata
|
51
78
|
)
|
52
79
|
|
53
|
-
|
80
|
+
return object
|
54
81
|
end
|
55
82
|
|
56
83
|
##
|
@@ -74,6 +101,25 @@ module Opener
|
|
74
101
|
Core::Syslog.info("Submitted response to #{next_url}", config.metadata)
|
75
102
|
end
|
76
103
|
|
104
|
+
##
|
105
|
+
# Sends the unsupported input to the last callback URL.
|
106
|
+
#
|
107
|
+
def handle_unsupported_language
|
108
|
+
last_url = config.callbacks.last
|
109
|
+
|
110
|
+
callback_handler.post(
|
111
|
+
last_url,
|
112
|
+
:input_url => config.input_url,
|
113
|
+
:identifier => config.identifier,
|
114
|
+
:metadata => config.metadata
|
115
|
+
)
|
116
|
+
|
117
|
+
Core::Syslog.info(
|
118
|
+
"Submitted input with an unsupported language to #{last_url}",
|
119
|
+
config.metadata
|
120
|
+
)
|
121
|
+
end
|
122
|
+
|
77
123
|
private
|
78
124
|
|
79
125
|
def add_transaction_attributes
|
data/opener-daemons.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency 'aws-sdk', '~> 1.0'
|
25
25
|
spec.add_dependency 'slop', '~> 3.0'
|
26
26
|
spec.add_dependency 'opener-callback-handler', '~> 1.0'
|
27
|
-
spec.add_dependency 'opener-core', '~> 2.
|
27
|
+
spec.add_dependency 'opener-core', '~> 2.3'
|
28
28
|
spec.add_dependency 'newrelic_rpm'
|
29
29
|
spec.add_dependency 'json-schema'
|
30
30
|
spec.add_dependency 'rollbar', '~> 1.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opener-daemons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wilco van Duinkerken
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '2.
|
62
|
+
version: '2.3'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '2.
|
69
|
+
version: '2.3'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: newrelic_rpm
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|