Skip to content

Commit b84ef51

Browse files
committed
remove redundant codes
1 parent bec742d commit b84ef51

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

Diff for: core/common/timer/Timer.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,6 @@ void Timer::Run() {
9090
LOG_INFO(sLogger, ("invalid timer event", "task is cancelled"));
9191
} else {
9292
e->Execute();
93-
// if (e->IsPeriodicalEvent()) {
94-
// auto pe = static_cast<PeriodicalTimerEvent*>(e.get());
95-
// pe->ScheduleNext();
96-
// if (!pe->IsStop()) {
97-
// PushEvent(std::move(e));
98-
// } else {
99-
// LOG_DEBUG(sLogger, ("periodical event schedule done", "exit"));
100-
// }
101-
// }
10293
}
10394
queueLock.lock();
10495
}

Diff for: core/common/timer/TimerEvent.h

-20
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class TimerEvent {
2727

2828
virtual bool IsValid() const = 0;
2929
virtual bool Execute() = 0;
30-
// virtual bool IsPeriodicalEvent() { return false; }
3130

3231
std::chrono::steady_clock::time_point GetExecTime() const { return mExecTime; }
3332
void SetExecTime(std::chrono::steady_clock::time_point nextExecTime) { mExecTime = nextExecTime; }
@@ -36,23 +35,4 @@ class TimerEvent {
3635
std::chrono::steady_clock::time_point mExecTime;
3736
};
3837

39-
// class PeriodicalTimerEvent : public TimerEvent {
40-
// public:
41-
// PeriodicalTimerEvent(int intervalSec)
42-
// : TimerEvent(std::chrono::steady_clock::now() + std::chrono::seconds(intervalSec)), mIntervalSec(intervalSec)
43-
// {}
44-
// virtual ~PeriodicalTimerEvent() = default;
45-
46-
// virtual bool IsValid() const = 0;
47-
// virtual bool Execute() = 0;
48-
// virtual bool IsPeriodicalEvent() override { return true; }
49-
// virtual void ScheduleNext() { mExecTime += std::chrono::seconds(mIntervalSec); }
50-
// virtual bool IsStop() = 0;
51-
52-
// std::chrono::steady_clock::time_point GetExecTime() const { return mExecTime; }
53-
54-
// protected:
55-
// int mIntervalSec;
56-
// };
57-
5838
} // namespace logtail

0 commit comments

Comments
 (0)