Explorar o código

Fix have entry removal

Tatsuhiro Tsujikawa %!s(int64=9) %!d(string=hai) anos
pai
achega
01f870221b
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 1 1
      src/HaveEraseCommand.cc
  2. 2 0
      src/TimerA2.h

+ 1 - 1
src/HaveEraseCommand.cc

@@ -61,7 +61,7 @@ void HaveEraseCommand::process()
 {
   // we are making a copy of current wallclock.
   auto expiry = global::wallclock();
-  expiry.advance(5_s);
+  expiry.sub(5_s);
 
   const auto& groups =
       getDownloadEngine()->getRequestGroupMan()->getRequestGroups();

+ 2 - 0
src/TimerA2.h

@@ -82,6 +82,8 @@ public:
 
   template <typename duration> void advance(const duration& t) { tp_ += t; }
 
+  template <typename duration> void sub(const duration& t) { tp_ -= t; }
+
   const Clock::time_point& getTime() const { return tp_; }
 
   static Timer zero() { return Timer(0_s); }