From 56ea680e46be2d08cd91921c78d5516d013bc09d Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 28 Aug 2020 21:03:23 +0200 Subject: [PATCH] Add telemetry to get insight into updates --- app/Http/Controllers/Admin/UpdateController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Admin/UpdateController.php b/app/Http/Controllers/Admin/UpdateController.php index f9c0b1d1e6..ac35327a2b 100644 --- a/app/Http/Controllers/Admin/UpdateController.php +++ b/app/Http/Controllers/Admin/UpdateController.php @@ -61,9 +61,9 @@ class UpdateController extends Controller /** * Show page with update options. * - * @throws NotFoundExceptionInterface - * @throws ContainerExceptionInterface * @return Factory|View + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function index() { @@ -100,6 +100,11 @@ class UpdateController extends Controller $checkForUpdates = (int) $request->get('check_for_updates'); $channel = $request->get('update_channel'); $channel = in_array($channel, ['stable', 'beta', 'alpha'], true) ? $channel : 'stable'; + + // store as telemetry + app('telemetry')->feature('admin.update.channel', $channel); + app('telemetry')->feature('admin.update.permission', (string) $checkForUpdates); + app('fireflyconfig')->set('permission_update_check', $checkForUpdates); app('fireflyconfig')->set('last_update_check', time()); app('fireflyconfig')->set('update_channel', $channel);