openstudio-analysis 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 910d9bf7e03884f0d18b769fbcf5bb348438fffa4de56590540679f5b193c848
4
- data.tar.gz: 702c4692f6ce7c4297965d6b60854657341e92f3efcf5b8ebbe312ae8cb73646
3
+ metadata.gz: b2b3fab59aeec813435361079d2ce2453b30c3a21d4c3d13addfede64fc944bb
4
+ data.tar.gz: 20c2f50da2c0f0e34076ad11680e584fd35f79bb688d5224b4fa5783173df77e
5
5
  SHA512:
6
- metadata.gz: ac4e0cd24adb96e06a35fc463b5588ac2f40c28e6b39e652c74351b63def71549e5f4a7859060d2f403c31c54a2d3275046f1353cc0f3d256d44aa9d5ec5f62e
7
- data.tar.gz: 7bdeefad3522338a73d725d10bc853b7e7a114657a3bd237a061e77eecb299b1b59d09fbbbe92eff76f507fd07bbde4bd7e6701f070ee6dd8ea2115d5ccb3d5a
6
+ metadata.gz: 3d34d8ea49de5a7f248643209d6c8d1942996dfedc91a57801faf2f664d0a04b06930d58f2bfbc3d2034a22f5bb637f06a759e0dd67524dd060c7c8d95fb93ba
7
+ data.tar.gz: 9a334296581594e233cca22f651da024be123696dab49d592d2a38bc29857585bed08ce1f8afa8c3bfc5f517632d5918bb0b9c5f02e70970473c5f525748bb5f
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  OpenStudio(R) Analysis Gem Change Log
2
2
  ==================================
3
3
 
4
+ Version 1.3.5
5
+ -------------
6
+ * Increase Timeouts and write_timeouts to deal with latencies for network related issues
7
+
4
8
  Version 1.3.4
5
9
  -------------
6
10
  * Update licenses
@@ -31,6 +31,9 @@ module OpenStudio
31
31
  # create connection with basic capabilities
32
32
  @conn = Faraday.new(url: @hostname) do |faraday|
33
33
  faraday.request :url_encoded # form-encode POST params
34
+ faraday.options.timeout = 300
35
+ faraday.options.open_timeout = 300
36
+ faraday.options.write_timeout = 1800
34
37
  faraday.use Faraday::Response::Logger, @logger
35
38
  # faraday.response @logger # log requests to STDOUT
36
39
  faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
@@ -40,6 +43,9 @@ module OpenStudio
40
43
  @conn_multipart = Faraday.new(url: @hostname) do |faraday|
41
44
  faraday.request :multipart
42
45
  faraday.request :url_encoded # form-encode POST params
46
+ faraday.options.timeout = 300
47
+ faraday.options.open_timeout = 300
48
+ faraday.options.write_timeout = 1800
43
49
  faraday.use Faraday::Response::Logger, @logger
44
50
  # faraday.response :logger # log requests to STDOUT
45
51
  faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
@@ -97,13 +103,17 @@ module OpenStudio
97
103
 
98
104
  # TODO: make this a display name and a machine name
99
105
  project_hash = { project: { name: (options[:project_name]).to_s } }
100
-
101
- response = @conn.post do |req|
102
- req.url '/projects.json'
103
- req.headers['Content-Type'] = 'application/json'
104
- req.body = project_hash.to_json
106
+ begin
107
+ response = @conn.post do |req|
108
+ req.url '/projects.json'
109
+ req.headers['Content-Type'] = 'application/json'
110
+ req.body = project_hash.to_json
111
+ end
112
+ puts "response.status: #{response.status}"
113
+ puts response.inspect
114
+ rescue Net::OpenTimeout => e
115
+ puts "new_project OpenTimeout: #{e.message}"
105
116
  end
106
-
107
117
  if response.status == 201
108
118
  project_id = JSON.parse(response.body)['_id']
109
119
 
@@ -204,16 +214,19 @@ module OpenStudio
204
214
  begin
205
215
  resp = @conn.get do |req|
206
216
  req.url 'status.json'
207
- req.options.timeout = 120
208
- req.options.open_timeout = 120
217
+ req.options.timeout = 300
218
+ req.options.open_timeout = 300
209
219
  end
210
-
220
+ puts "machine_status resp.status: #{resp.status}"
221
+ puts resp.inspect
211
222
  if resp.status == 200
212
223
  j = JSON.parse resp.body, symbolize_names: true
213
224
  status = j if j
214
225
  end
215
- rescue Faraday::ConnectionFailed
216
- rescue Net::ReadTimeout
226
+ rescue Faraday::ConnectionFailed => e
227
+ puts "machine_Status ConnectionFailed: #{e.message}"
228
+ rescue Net::ReadTimeout => e
229
+ puts "machine_Status ReadTimeout: #{e.message}"
217
230
  end
218
231
 
219
232
  status
@@ -466,7 +479,8 @@ module OpenStudio
466
479
  req.url "projects/#{project_id}/analyses.json"
467
480
  req.headers['Content-Type'] = 'application/json'
468
481
  req.body = formulation_json.to_json
469
- req.options[:timeout] = 600 # seconds
482
+ req.options.timeout = 600 # seconds
483
+ req.options.write_timeout = 1800
470
484
  end
471
485
 
472
486
  if response.status == 201
@@ -486,7 +500,8 @@ module OpenStudio
486
500
 
487
501
  payload = { file: Faraday::UploadIO.new(options[:upload_file], 'application/zip') }
488
502
  response = @conn_multipart.post "analyses/#{analysis_id}/upload.json", payload do |req|
489
- req.options[:timeout] = 1800 # seconds
503
+ req.options.timeout = 1800 # seconds
504
+ req.options.write_timeout = 1800
490
505
  end
491
506
 
492
507
  if response.status == 201
@@ -632,7 +647,8 @@ module OpenStudio
632
647
  req.url "analyses/#{analysis_id}/action.json"
633
648
  req.headers['Content-Type'] = 'application/json'
634
649
  req.body = options.to_json
635
- req.options[:timeout] = 1800 # seconds
650
+ req.options.timeout = 1800 # seconds
651
+ req.options.write_timeout = 1800
636
652
  end
637
653
 
638
654
  if response.status == 200
@@ -7,6 +7,6 @@ module OpenStudio
7
7
  module Analysis
8
8
  # format should be ^.*\-{1}[a-z]+[0-9]+
9
9
  # for example: -rc1, -beta6, -customusecase0
10
- VERSION = '1.3.4'.freeze
10
+ VERSION = '1.3.5'.freeze
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-analysis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Long
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcl
@@ -202,7 +202,7 @@ homepage: http://openstudio.nrel.gov
202
202
  licenses:
203
203
  - BSD
204
204
  metadata: {}
205
- post_install_message:
205
+ post_install_message:
206
206
  rdoc_options: []
207
207
  require_paths:
208
208
  - lib
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  requirements: []
220
220
  rubygems_version: 3.1.4
221
- signing_key:
221
+ signing_key:
222
222
  specification_version: 4
223
223
  summary: Create JSON, ZIP to communicate with OpenStudio Distributed Analysis in the
224
224
  Cloud