#!/usr/bin/perl

# Copyright (C) 2018-2020 SUSE LLC
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, see <http://www.gnu.org/licenses/>.

use Mojo::Base -strict;

use FindBin;
use lib "$FindBin::RealBin/../lib";

use OpenQA::LiveHandler;
use OpenQA::Utils qw(service_port set_listen_address fix_top_level_help);

fix_top_level_help;

# ensure the web socket connection won't timeout
$ENV{MOJO_INACTIVITY_TIMEOUT} ||= 15 * 60;

set_listen_address(service_port('livehandler'));
OpenQA::LiveHandler::run;
