Skip to content

Commit 72be39a

Browse files
authored
[Fix] Only download Winetricks every 7 days (#3527)
1 parent c0263fa commit 72be39a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/backend/tools/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ import { lt as semverLt } from 'semver'
5050
import { createAbortController } from '../utils/aborthandler/aborthandler'
5151
import { gameManagerMap } from '../storeManagers'
5252
import { sendFrontendMessage } from '../main_window'
53+
import {
54+
DAYS,
55+
downloadFile as downloadFileInet
56+
} from '../utils/inet/downloader'
5357

5458
interface Tool {
5559
name: string
@@ -443,9 +447,11 @@ export const Winetricks = {
443447

444448
try {
445449
logInfo('Downloading Winetricks', LogPrefix.WineTricks)
446-
const res = await axios.get(url, { timeout: 1000 })
447-
const file = res.data
448-
writeFileSync(path, file)
450+
await downloadFileInet(url, {
451+
writeToFile: path,
452+
maxCache: 7 * DAYS,
453+
axiosConfig: { responseType: 'text' }
454+
})
449455
await chmod(path, 0o755)
450456
return
451457
} catch (error) {

0 commit comments

Comments
 (0)