Bugzilla – Attachment 68414 Details for
Bug 19176
Dates comparison fails on slow server
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19176: Reduce the number of seconds to 5
Bug-19176-Reduce-the-number-of-seconds-to-5.patch (text/plain), 1.41 KB, created by
Jonathan Druart
on 2017-10-23 14:44:29 UTC
(
hide
)
Description:
Bug 19176: Reduce the number of seconds to 5
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-10-23 14:44:29 UTC
Size:
1.41 KB
patch
obsolete
>From 415b286f97a24133f6f20c0b779399b5f809373d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 23 Oct 2017 11:38:58 -0300 >Subject: [PATCH] Bug 19176: Reduce the number of seconds to 5 > >--- > t/Test/Dates.t | 2 +- > t/lib/Dates.pm | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/t/Test/Dates.t b/t/Test/Dates.t >index 5241f9e9ab..78206e2fc0 100644 >--- a/t/Test/Dates.t >+++ b/t/Test/Dates.t >@@ -14,7 +14,7 @@ is( t::lib::Dates::compare( $dt_2, $dt_1 ), 1, '2018 is after 2017' ); > is( t::lib::Dates::compare( $date_1, $date_2 ), -1, '2017 is before 2018 (strings comparison)' ); > is( t::lib::Dates::compare( $date_2, $date_1 ), 1, '2018 is after 2017 (strings comparison)' ); > >-my $dt_3 = $dt_1->clone->subtract( seconds => 59 ); >+my $dt_3 = $dt_1->clone->subtract( seconds => 5 ); > is( t::lib::Dates::compare( $dt_1, $dt_3 ), > 0, 'If there is less than 1min, the dates are considered identicals' ); > is( t::lib::Dates::compare( $dt_3, $dt_1 ), >diff --git a/t/lib/Dates.pm b/t/lib/Dates.pm >index 1ba4d223bf..4e0f25faf4 100644 >--- a/t/lib/Dates.pm >+++ b/t/lib/Dates.pm >@@ -20,7 +20,7 @@ sub compare { > $dt_got->set_time_zone('floating'); > $dt_expected->set_time_zone('floating'); > my $diff = $dt_got->epoch - $dt_expected->epoch; >- if ( abs($diff) < 60 ) { return 0 } >+ if ( abs($diff) < 6 ) { return 0 } > return $diff > 0 ? 1 : -1; > } > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19176
:
66493
|
66563
|
67322
|
68082
|
68412
|
68413
|
68414
|
68448
|
68449
|
68450
|
68848
|
68923