Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit eca0888

Browse files
committed
fix: remove deno cache (#118)
1 parent 06048eb commit eca0888

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

server/app.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,29 +1256,17 @@ export class Application {
12561256
return await Deno.readFile(cacheFilename)
12571257
}
12581258

1259-
try {
1260-
const p = Deno.run({
1261-
cmd: [Deno.execPath(), 'cache', reload ? '--reload' : '', u.toString()],
1262-
stdout: 'inherit',
1263-
stderr: 'piped'
1264-
})
1265-
await Deno.stderr.write(await p.stderrOutput())
1266-
await p.status()
1267-
p.close()
1268-
if (existsFileSync(cacheFilename)) {
1269-
return await Deno.readFile(cacheFilename)
1270-
}
1271-
} catch (e) { }
1272-
12731259
// download dep when deno cache failed
1274-
console.log(colors.green('Force download'), url)
1260+
log.info('Download', url)
12751261
const buffer = await fetch(u.toString()).then(resp => {
12761262
if (resp.status !== 200) {
12771263
return Promise.reject(new Error(resp.statusText))
12781264
}
12791265
return resp.arrayBuffer()
12801266
})
1281-
return await Deno.readAll(new Deno.Buffer(buffer))
1267+
const content = await Deno.readAll(new Deno.Buffer(buffer))
1268+
await Deno.writeFile(cacheFilename, content)
1269+
return content
12821270
}
12831271

12841272
/** bundle modules for production. */

server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export async function serve(hostname: string, port: number, app: Application) {
166166
}
167167
} catch (err) {
168168
if (err instanceof Deno.errors.AddrInUse) {
169-
log.warn(`port ${port} already in use, try ${port + 1}`)
169+
log.warn(`port ${port} already in use, try ${port + 1}...`)
170170
port++
171171
} else {
172172
log.fatal(err.message)

0 commit comments

Comments
 (0)