Skip to content

Commit

Permalink
Merge pull request #11 from brycefranzen/add_connect_timeout
Browse files Browse the repository at this point in the history
Add connect_timeout for guzzle
  • Loading branch information
sergeyklay authored Jul 7, 2018
2 parents b685f07 + 8e3312e commit 7781e3d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A minimal service provider to set up and use InfluxDB SDK in Laravel 5
```js
"require": {
// ...
"pdffiller/laravel-influx-provider": "^1.2"
"pdffiller/laravel-influx-provider": "^1.6"
}
```
- Add these lines to `config/app.php`
Expand All @@ -33,6 +33,9 @@ LARAVEL_INFLUX_PROVIDER_PASSWORD=some_password
LARAVEL_INFLUX_PROVIDER_HOST=host
LARAVEL_INFLUX_PROVIDER_PORT=8086
LARAVEL_INFLUX_PROVIDER_DATABASE=database_name
LARAVEL_INFLUX_PROVIDER_VERIFY_SSL=false
LARAVEL_INFLUX_PROVIDER_TIMEOUT=0
LARAVEL_INFLUX_PROVIDER_CONNECT_TIMEOUT=0
```

### How to use
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"php": ">=5.6",
"illuminate/log": "5.2.*|5.3.*|5.4.*",
"illuminate/support": "5.2.*|5.3.*|5.4.*",
"influxdb/influxdb-php": "^1.4",
"influxdb/influxdb-php": "1.14.*",
"monolog/monolog": "^1.19"
},
"require-dev": {
Expand Down
5 changes: 4 additions & 1 deletion src/InfluxDBServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public function register()
config('influxdb.host'),
config('influxdb.port'),
'' //config('influxdb.database')
), config('influxdb.timeout')
),
config('influxdb.timeout'),
(config('influxdb.verify_ssl') === 'true'),
config('influxdb.connect_timeout')
);
} catch (ClientException $e) {
// die silently
Expand Down
10 changes: 10 additions & 0 deletions src/config/InfluxDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,18 @@
*/
'log_message_lines_limit' => env('LARAVEL_INFLUX_PROVIDER_LOG_MESSAGE_LINES_LIMIT', 5),

/**
* Verify SSL
*/
'verify_ssl' => env('LARAVEL_INFLUX_PROVIDER_VERIFY_SSL', 'false'),

/**
* Timeout
*/
'timeout' => env('LARAVEL_INFLUX_PROVIDER_TIMEOUT', 0),

/**
* Connect Timeout
*/
'connect_timeout' => env('LARAVEL_INFLUX_PROVIDER_CONNECT_TIMEOUT', 0),
];

0 comments on commit 7781e3d

Please sign in to comment.