Skip to content

Commit 2109f36

Browse files
committed
🚑 Fix order of thread, event
1 parent 16fbe6e commit 2109f36

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/repl_python_wakatime/backends/codestats.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ class CodeStats(Hook):
3636
interval: int = 60 # interval at which stats are sent
3737
timeout: ClientTimeout | None = None
3838

39-
def __post_init__(
40-
self,
41-
) -> None:
39+
def __post_init__(self) -> None:
4240
"""Init.
4341
4442
:rtype: None
@@ -63,10 +61,10 @@ def __post_init__(
6361
self.timeout = ClientTimeout(10)
6462
self.session = None
6563
self.loop = asyncio.new_event_loop()
66-
self.thread = Thread(target=self.worker, daemon=True)
67-
self.thread.start()
6864
self.event = Event()
6965
self.lock = Lock()
66+
self.thread = Thread(target=self.worker, daemon=True)
67+
self.thread.start()
7068

7169
def __call__(self, xp: int = 1) -> None:
7270
"""Add xp.

0 commit comments

Comments
 (0)