Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "witnet.io",
"private": true,
"version": "2.4.1",
"version": "2.4.2",
"type": "module",
"scripts": {
"build": "nuxt build",
Expand Down
8 changes: 1 addition & 7 deletions server/api/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,7 @@ async function downloadImages(items: Array<{ bannerImage: string }>) {
return response.arrayBuffer()
})
.then((arrayBuffer) => {
// Don't use fs.writeFileSync because it will block the event loop
// and cause performance issues
fs.writeFile(filePath, Buffer.from(arrayBuffer), {}, (err) => {
if (err) {
console.error('Error writing image to cache:', err)
}
})
fs.writeFileSync(filePath, Buffer.from(arrayBuffer), {})
return `/api/image/${hash}${ext}`
})
.catch((err) => {
Expand Down