Skip to content

innreport failure when archive is false #247

@Julien-Elie

Description

@Julien-Elie

When archive is false in innreport.conf, an illegal division by zero is reported:

    $image->string(
        gdSmallFont(), $xmax / 2, $y_in,
        (sprintf "Avg: %5.1f $unit", $s_in / $t_in * $factor), $black
    );

$t_in equals 0 when there isn't any date in the first field of innreport.db:

news-notice.html|Jan 5 03:00:02 -- Jan 6 03:00:02|407991|31972|69.0 MB|632353|44546|539.2 MB

The expected name is something like news-notice.2022.01.02-04.15.02.html but that is not always true, whence a wrong computation here:

                my ($year) = $k =~ m/^news-notice\.
                       (\d+)\.\d+\.\d+-\d+.\d+.\d+$HTML_EXTENSION/x;
                $dates{$start_sec} = $end_sec;

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: utilitiesRelated to utilitiesP: mediumMedium prioritybugSomething isn't working

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions