Commit 4b8b909
committed
refactor(details): improve thread safety and resource management in
This commit enhances the `TranslationRepositoryImpl` by introducing thread-safe cache access using a Mutex and ensuring proper disposal of the HTTP client.
- **refactor(details)**: Implemented `AutoCloseable` in `TranslationRepositoryImpl` to properly close the `httpClient`.
- **refactor(details)**: Added `Mutex` to synchronize access to the translation cache, preventing potential race conditions.
- **refactor(details)**: Removed unused `GitHubStoreLogger` dependency from `TranslationRepositoryImpl`.TranslationRepositoryImpl
1 parent b332a5d commit 4b8b909
1 file changed
Lines changed: 15 additions & 8 deletions
File tree
- feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository
Lines changed: 15 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
59 | | - | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
167 | 174 | | |
0 commit comments