<commit_before>#!/usr/bin/env perl

use strict;
use warnings;
use Config::Simple;
use File::Basename;

my $dir=dirname($0);
chdir $dir . '/..';

my $cfg = new Config::Simple();
$cfg->read('conf/settings.ini');
our $config = $cfg->vars();

$config->{'daemon.listen_ip'}   ||= '127.0.0.1';
$config->{'daemon.listen_port'} ||= '8090';
$config->{'daemon.backend'}     ||= 'hypnotoad';

$ENV{'PERL5LIB'} = 'lib';

if ($config->{'daemon.backend'} eq 'morbo'){
  exec ('/usr/bin/morbo', '-l', 'http://' . $config->{'daemon.listen_ip'} . ':' . $config->{'daemon.listen_port'}, '-v', 'vroom.pl');
}
else{
  exec ('/usr/bin/hypnotoad', '-f', 'vroom.pl');
}
<commit_msg>Monitor the configuration file when running under morbo This way config updates are taken immediatly<commit_after>#!/usr/bin/env perl

use strict;
use warnings;
use Config::Simple;
use File::Basename;

my $dir=dirname($0);
chdir $dir . '/..';

my $cfg = new Config::Simple();
$cfg->read('conf/settings.ini');
our $config = $cfg->vars();

$config->{'daemon.listen_ip'}   ||= '127.0.0.1';
$config->{'daemon.listen_port'} ||= '8090';
$config->{'daemon.backend'}     ||= 'hypnotoad';

$ENV{'PERL5LIB'} = 'lib';

if ($config->{'daemon.backend'} eq 'morbo'){
  exec ('/usr/bin/morbo', '-l', 'http://' . $config->{'daemon.listen_ip'} . ':' . $config->{'daemon.listen_port'}, '-w', 'conf/settings.ini', '-v', 'vroom.pl');
}
else{
  exec ('/usr/bin/hypnotoad', '-f', 'vroom.pl');
}

{'fraction_non_alphanumeric': 0.2702513966480447, 'fraction_numerical': 0.01675977653631285, 'mean_word_length': 4.554263565891473, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '736310', 'n_tokens_mistral': 580, 'n_tokens_neox': 565, 'n_words': 110}