Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #440 from beyondcode/revert-115-stats-url
Browse files Browse the repository at this point in the history
Revert "Add support for overriding stats logger's base URL"
  • Loading branch information
rennokki committed Aug 13, 2020
2 parents 9d8e2ff + b2b2961 commit fddf4d5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
8 changes: 0 additions & 8 deletions config/websockets.php
Expand Up @@ -92,14 +92,6 @@
*/
'delete_statistics_older_than_days' => 60,

/*
* By default, the websockets server attempts to connect to whatever
* your APP_URL is set to. If running in a more complex environment,
* you may wish to override the base URL for internal requests to
* allow statistics to be collected.
*/
'base_url_override' => null,

/*
* Use an DNS resolver to make the requests to the statistics logger
* default is to resolve everything to 127.0.0.1.
Expand Down
13 changes: 1 addition & 12 deletions src/Statistics/Logger/HttpStatisticsLogger.php
Expand Up @@ -79,7 +79,7 @@ public function save()
$this
->browser
->post(
$this->storeStatisticsUrl(),
action([WebSocketStatisticsEntriesController::class, 'store']),
['Content-Type' => 'application/json'],
stream_for(json_encode($postData))
);
Expand All @@ -88,15 +88,4 @@ public function save()
$statistic->reset($currentConnectionCount);
}
}

protected function storeStatisticsUrl(): string
{
$action = [WebSocketStatisticsEntriesController::class, 'store'];

$overridenUrl = config('websockets.statistics.base_url_override');

return $overridentUrl
? $overridenUrl.action($action, [], false)
: action($action);
}
}

0 comments on commit fddf4d5

Please sign in to comment.