File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ namespace logtail {
26
26
27
27
HistoryFileImporter::HistoryFileImporter () {
28
28
LOG_INFO (sLogger , (" HistoryFileImporter" , " init" ));
29
- static auto _doNotQuitThread = CreateThread ([this ]() { Run (); });
29
+ mThread = CreateThread ([this ]() { Run (); });
30
30
}
31
31
32
32
void HistoryFileImporter::PushEvent (const HistoryFileEvent& event) {
Original file line number Diff line number Diff line change 16
16
17
17
#pragma once
18
18
#include < string>
19
- #include < vector>
20
19
#include < unordered_map>
21
20
#include " common/StringTools.h"
22
21
#include " common/CircularBuffer.h"
23
22
#include " config/Config.h"
23
+ #include " common/Thread.h"
24
24
25
25
namespace logtail {
26
26
@@ -44,8 +44,8 @@ class HistoryFileImporter {
44
44
HistoryFileImporter ();
45
45
46
46
static HistoryFileImporter* GetInstance () {
47
- static HistoryFileImporter sFileImporter ;
48
- return & sFileImporter ;
47
+ static HistoryFileImporter* sFileImporter = new HistoryFileImporter ;
48
+ return sFileImporter ;
49
49
}
50
50
51
51
void PushEvent (const HistoryFileEvent& event);
@@ -63,6 +63,7 @@ class HistoryFileImporter {
63
63
CircularBufferSem<HistoryFileEvent, HISTORY_EVENT_MAX> mEventQueue ;
64
64
std::unordered_map<std::string, int64_t > mCheckPoints ;
65
65
FILE* mCheckPointPtr ;
66
+ ThreadPtr mThread ;
66
67
};
67
68
68
69
} // namespace logtail
You can’t perform that action at this time.
0 commit comments