如何修复 Perl Business::Hours Bad order 2 严重错误?
How to fix Perl Business::Hours Bad order 2 critical error?
我们有 Request Tracker 4.4.3. There we have an automated script that uses Business::Hours 分布。这是重要的部分:
sub IsApplicable {
my $self = shift;
my $bhours = $self->BusinessHours;
my $ticket = $self->TicketObj;
my $due = $ticket->DueObj->Unix;
my $bseconds = $bhours->between( time(), $due );
}
有时我们会收到 stderr 错误:
[23406] [Wed Mar 13 07:40:09 2019] [critical]: Set::IntSpan::_copy_run_list: Bad order 2: 1552462809-1552462694
at /usr/local/share/perl5/Business/Hours.pm line 269. (/opt/rt4/bin/../lib/RT.pm:408)
Set::IntSpan::_copy_run_list: Bad order 2: 1552462809-1552462694
at /usr/local/share/perl5/Business/Hours.pm line 269.
好像没有什么意义,1552462809-1552462694差不多就是115了
如何analyze/fix这个错误?
根据文档Business::Hours:
between START, END
Returns the number of business seconds between START and END Both
START and END should be specified in seconds since the epoch.
Returns -1 if START or END are outside the calculated business hours.
所以可能 END 必须大于 START
我们有 Request Tracker 4.4.3. There we have an automated script that uses Business::Hours 分布。这是重要的部分:
sub IsApplicable {
my $self = shift;
my $bhours = $self->BusinessHours;
my $ticket = $self->TicketObj;
my $due = $ticket->DueObj->Unix;
my $bseconds = $bhours->between( time(), $due );
}
有时我们会收到 stderr 错误:
[23406] [Wed Mar 13 07:40:09 2019] [critical]: Set::IntSpan::_copy_run_list: Bad order 2: 1552462809-1552462694
at /usr/local/share/perl5/Business/Hours.pm line 269. (/opt/rt4/bin/../lib/RT.pm:408)
Set::IntSpan::_copy_run_list: Bad order 2: 1552462809-1552462694
at /usr/local/share/perl5/Business/Hours.pm line 269.
好像没有什么意义,1552462809-1552462694差不多就是115了
如何analyze/fix这个错误?
根据文档Business::Hours:
between START, END
Returns the number of business seconds between START and END Both START and END should be specified in seconds since the epoch.
Returns -1 if START or END are outside the calculated business hours.
所以可能 END 必须大于 START