Scheduled rebooting memory leak
maximilianvb
HOBBYOP

2 years ago

Hi, it would be nice with scheduled rebooting if possible to combat memory leak in backend. Yes it's not optimal to have a memory leak but it's a very small leak I'm trying to debug in the meantime I want to reboot the backend once a day.

27 Replies

brody
EMPLOYEE

2 years ago

thanks for sharing your usecase!


brody
EMPLOYEE

2 years ago

this template was made with your exact use case in mind -


brody
EMPLOYEE

2 years ago

n/a


maximilianvb
HOBBYOP

2 years ago

thanks


brody
EMPLOYEE

2 years ago

let me know if you run into any difficulties


maximilianvb
HOBBYOP

2 years ago

Hi, I tested this out but for me it did not work as planned


maximilianvb
HOBBYOP

2 years ago

it's a bit hard to debug because I don't know what part I've done wrong


maximilianvb
HOBBYOP

2 years ago

it's not clear from the instructions if I need to use your template or not it says this:

"Once the bookmarklet has been added to your bookmark bar, open your Railway project and desired service,"

What do you mean desired service? The Railway Cron service or something else?


maximilianvb
HOBBYOP

2 years ago

I think it would make more sense in your instructions to put the "deploy this template" first because it I put the schedule_1 and stuff like that in my other service


jeremybarbet
PRO

2 years ago

you could also do it in code. I'm also doing a restart once a day with a cron job

node+nestjs

@Cron('0 8 * * *', {
  timeZone: constants.worker.timezones.iceland,
})
async restart() {
  await this.railwayService.restart(RailwayServices.api);
}

restart() {
  await this.axiosService.post(this.config.url, {
    headers: {
      Authorization: `Bearer ${this.config.apiKey}`,
      'Content-Type': 'application/json',
    },
    data: {
      query: `
        mutation DeploymentRestart($id: String!) {
          deploymentRestart(id: $id)
        }
      `,
      variables: { id },
    },
  });
}

brody
EMPLOYEE

2 years ago

this is exactly what the service I made does.


brody
EMPLOYEE

2 years ago

have you read the templates overview?
I thought I did a pretty good job at explaining every little detail needed to deploy it


maximilianvb
HOBBYOP

2 years ago

seems to work now


maximilianvb
HOBBYOP

2 years ago

as a railway beginner i didn't understand you had to deploy the template


brody
EMPLOYEE

2 years ago

uhhh well i would have never imagined id need to tell you to deploy the template


brody
EMPLOYEE

2 years ago

can you help me understand the thought process behind being able to use a template without ever deploying it?


maximilianvb
HOBBYOP

2 years ago

I don't know I must be stupid


maximilianvb
HOBBYOP

2 years ago

i thought I would make it myself by following the text and skip the template


maximilianvb
HOBBYOP

2 years ago

I never used CRON before so this might add to the confusion. I followed everything in the text, I put the schedule_1 and token on my service variables for the thing I wanted to restart


maximilianvb
HOBBYOP

2 years ago

anyway I don't think there is much to improve in the instructions, it comes from inexperience with both railway and cron on my side


brody
EMPLOYEE

2 years ago

sounds good, so you did get it to work in the end?


maximilianvb
HOBBYOP

2 years ago

yes


brody
EMPLOYEE

2 years ago

awsome, and i always wanna hear peoples usecase for it, would you mind sharing?


brody
EMPLOYEE

2 years ago

same as this threads title?


maximilianvb
HOBBYOP

2 years ago

ye


brody
EMPLOYEE

2 years ago

cool, thanks for sharing


maximilianvb
HOBBYOP

2 years ago

thanks


Loading...