Class: Aptly::Configuration
- Inherits:
-
Object
- Object
- Aptly::Configuration
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/aptly/configuration.rb
Overview
Configuration.
Instance Attribute Summary collapse
-
#host ⇒ String
deprecated
Deprecated.
use #uri
-
#path ⇒ String
deprecated
Deprecated.
use #uri
-
#port ⇒ Integer
deprecated
Deprecated.
use #uri
-
#timeout ⇒ Object
The request read timeout in seconds.
-
#uri ⇒ Object
Generally any suitable URI is allowed.
-
#write_timeout ⇒ Object
The request write timeout in seconds.
Instance Method Summary collapse
-
#initialize(uri: URI::HTTP.build(host: 'localhost', port: 80, path: '/'), timeout: [60, faraday_default_timeout].max, write_timeout: [10 * 60, timeout].max, host: nil, port: nil, path: nil) ⇒ Configuration
constructor
Creates a new instance.
Constructor Details
#initialize(uri: URI::HTTP.build(host: 'localhost', port: 80, path: '/'), timeout: [60, faraday_default_timeout].max, write_timeout: [10 * 60, timeout].max, host: nil, port: nil, path: nil) ⇒ Configuration
Creates a new instance.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/aptly/configuration.rb', line 60 def initialize(uri: URI::HTTP.build(host: 'localhost', port: 80, path: '/'), timeout: [60, faraday_default_timeout].max, write_timeout: [10 * 60, timeout].max, host: nil, port: nil, path: nil) @timeout = timeout @write_timeout = write_timeout @uri = nil @uri = uri unless host || port || path return if @uri @uri = fallback_uri(host, port, path) end |
Instance Attribute Details
#host ⇒ String
use #uri
Returns host name to talk to.
|
# File 'lib/aptly/configuration.rb', line 75
|
#path ⇒ String
use #uri
Returns path to use (defaults to /).
|
# File 'lib/aptly/configuration.rb', line 83
|
#port ⇒ Integer
use #uri
Returns port to talk to host to on.
|
# File 'lib/aptly/configuration.rb', line 79
|
#timeout ⇒ Object
The request read timeout in seconds. HTTP connections not responding in this time limit will raise an error. Note that the server-side API is currently synchronous so a read request may time out for no better reason than it not getting a suitable database lock in time, so allowing for some leeway is recommended here. github.com/smira/aptly/pull/459
37 38 39 |
# File 'lib/aptly/configuration.rb', line 37 def timeout @timeout end |
#uri ⇒ Object
Generally any suitable URI is allowed. This can also be a Unix domain socket which needs to be used in the notation unix:/tmp/sock.
27 28 29 |
# File 'lib/aptly/configuration.rb', line 27 def uri @uri end |
#write_timeout ⇒ Object
The request write timeout in seconds. HTTP connections not responding in this time limit will raise an error. When pushing data into Aptly or publishing large repositories this value should be suitably high. This timeout is used for API calls which we expect to need a write-lock on the server. Using a value of a couple minutes is recommended if you have concurrent write requests (multiple uploads from different sources) or the server performance isn’t always assured (slow disk, load spikes).
49 50 51 |
# File 'lib/aptly/configuration.rb', line 49 def write_timeout @write_timeout end |