Gustavo
Gustavo
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
I understood that this description was enough, in this case, just copying the code into this folder structure should work https://discord.com/channels/713503345364697088/1166349559665012846/1166794385866899559
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
Good morning guys, any news on the subject? I don't have the knowledge about infrastructure to test what the error could be... In other providers, both the strategy of storing the file in memory as Buffer or saving a local copy are working, in Railway it still doesn't finalize the promises...
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
Hello Thalles, In fact I was doing exactly as you said, the problem was the same, for the promise that converting the upload file into a buffer or stream (I tried both), never ends.
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
I tried to include as much detail as possible in the code without exporting what is sensitive but still leaving it as close to my structure as possible.
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
+/- 700kb
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
No description
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
The MultipartFile appears normally in the log
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
Change the strategy to not use buffers in memory, again, not works
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
async saveFileOnDisk(file: MultipartFile) {
return new Promise<string>((resolve, reject) => {
if (!fs.existsSync('files')) {
console.log("-> Dir 'files' não existe, criando...")
fs.mkdirSync('files')
}

const fileName = file.filename
console.log("-> Salvando arquivo", fileName)

const filePath = `files/${fileName}`

console.log(file) <- File ok

const fileStream = fs.createWriteStream(filePath)
file.file.pipe(fileStream)


fileStream.on("finish", () => {
console.log(`-> Arquivo ${fileName} salvo em disco temporariamente com sucesso.`)
resolve(filePath)
})

fileStream.on("error", (error) => {
console.log(`-> Erro ao salvar o arquivo ${fileName}:`, error)
reject(error)
})
})
}
async saveFileOnDisk(file: MultipartFile) {
return new Promise<string>((resolve, reject) => {
if (!fs.existsSync('files')) {
console.log("-> Dir 'files' não existe, criando...")
fs.mkdirSync('files')
}

const fileName = file.filename
console.log("-> Salvando arquivo", fileName)

const filePath = `files/${fileName}`

console.log(file) <- File ok

const fileStream = fs.createWriteStream(filePath)
file.file.pipe(fileStream)


fileStream.on("finish", () => {
console.log(`-> Arquivo ${fileName} salvo em disco temporariamente com sucesso.`)
resolve(filePath)
})

fileStream.on("error", (error) => {
console.log(`-> Erro ao salvar o arquivo ${fileName}:`, error)
reject(error)
})
})
}
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
Not seem like a code issue, now im trying to write a file on the app root directory and the promise never ends
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
hmmm ok
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
nop, is from fastify
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
18.18
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
o, finded, it is 18
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
I didn't find it, but it must be 18 default
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
How do i find the version in production?
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
No description
39 replies
RRailway
Created by Gustavo on 10/24/2023 in #✋|help
Does Railway blocks memory for files on runtime?
af0ccfe5-cb9d-43cd-9c80-2ba515dc53b2
39 replies
RRailway
Created by Gustavo on 10/20/2023 in #✋|help
My Redis database is restarting over and over without stop!
Ok, create another Redis service works
18 replies
RRailway
Created by Gustavo on 10/20/2023 in #✋|help
My Redis database is restarting over and over without stop!
Redis on Railway stop working over 500mb in memory?
18 replies