Fixes #618 - Only fetch Segment key if we want to help usage stats.

This commit is contained in:
James Brooks
2015-05-02 09:29:00 +01:00
parent 444b236f9f
commit 8a9456ab42
+7 -5
View File
@@ -33,11 +33,13 @@ class LoadConfigServiceProvider extends ServiceProvider
}
// Set the Segment.com settings.
try {
$segmentRepository = $this->app->make('CachetHQ\Cachet\Segment\RepositoryInterface');
$this->app->config->set('segment.write_key', $segmentRepository->fetch());
} catch (Exception $e) {
// Don't throw any errors, we may not be able to fetch.
if (Setting::get('app_track')) {
try {
$segmentRepository = $this->app->make('CachetHQ\Cachet\Segment\RepositoryInterface');
$this->app->config->set('segment.write_key', $segmentRepository->fetch());
} catch (Exception $e) {
// Don't throw any errors, we may not be able to fetch.
}
}
// Override default app values.