Commit 233ea19
⚡ optimize: replace synchronous I/O with asynchronous in app.ts
- Replaced `fs.readFileSync` and `fs.existsSync` with `fs.promises.readFile` in `getSelectedApp` and `selectApp`.
- Replaced `fs.writeFileSync` with `fs.promises.writeFile` in `selectApp`.
- Converted `getSelectedApp` to an `async` function.
- Improved responsiveness by preventing event loop blocking during file I/O.
- Handled `ENOENT` to maintain original "file not found" behavior efficiently.
Co-authored-by: sunnylqm <615282+sunnylqm@users.noreply.github.com>1 parent d48a755 commit 233ea19
1 file changed
+15
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
35 | 42 | | |
36 | | - | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
| |||
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
141 | | - | |
| 147 | + | |
142 | 148 | | |
143 | 149 | | |
144 | 150 | | |
| |||
0 commit comments