Browse Source

Fix have entry removal

Tatsuhiro Tsujikawa 9 năm trước cách đây
mục cha
commit
01f870221b
2 tập tin đã thay đổi với 3 bổ sung1 xóa
  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); }