Repository navigation
refactor(server, web)!: store latest immich version available on the server - #3565
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
|
Can we just set up a cron to run every hour or so and then store the updated version info in memory instead? |
|
I chose an interval rather than a cron, because I'm afraid that every x hours all users make a request to GitHub at the same time which would stress GitHub servers |
|
And yeah it's probably better to just store it in memory |
|
What do you think about getting the current release information from immich.app? We would not need to worry about rate limits afaik |
I think we'll need to have rate limits for immich.app,if we use it to retrieve the latest immich version. Plus it adds an intermediary: when releasing a new version, the version stored on immich.app will always be a few minutes out of date. I don't mind using immich.app, but it will probably need extra work |
|
We have a workflow that runs on release and the docker images are not available until a few minutes later anyways, so that doesn't seem like much of a problem. Afaik there are no rate limits on Vercel, especially for serving static content. |
|
@jrasm91 Should the server make an API request right after the startup ? |
9b62897 to
96d9512
Compare
96d9512 to
d7f72d7
Compare
0bb759d to
e870357
Compare
9798f30 to
1891163
Compare
1891163 to
9a885e4
Compare
|
I think something's gone wrong with your merge from main, some of the things that have been added there recently are showing up as new in your diff. |
cc99607 to
614c61e
Compare
dbf292c to
6e13fab
Compare
1d4d07f to
e99e576
Compare
jrasm91
left a comment
There was a problem hiding this comment.
@martabal I simplified things quite a bit, hopefully they are all OK.
- The check runs on start up
- The check runs on a cron job every hour and does not deal with
setIntervalor the scheduler registry anymore - The user gets an event pushed to them when they connect via a web socket
- The user gets an event pushed to them when there is a new version available
- The check is disabled when
NODE_ENV=development
|
We talked about using cron job. The issue with cron job is that all users will request GitHub servers at the exact same time and could stress them |
bo0tzz
left a comment
There was a problem hiding this comment.
Like Martin said, we should be very sure that we don't have all the instances hammering github at the exact same moment.
cf2c7e7 to
e2c28cd
Compare
|
I don't think it would be an issue personally, but it was easy enough to changed it to an interval (which is still declarative) and make it dependent on server start-up time instead. |
e2c28cd to
deb629e
Compare
deee07d to
c098575
Compare
Currently, every time the admins hit refresh, they hit the GitHub API to retrieve the latest Immich version. If the version on GitHub differs from the server version, the web and mobile clients will notify the admins about the availability of a new Immich version.
However, excessive web refreshes ( by consequences on the GitHub API too ) can lead Github to ban your public IP address. To mitigate this risk and improve the users privacies, this PR move the logic from the clients to the server. Now, the server will fetch the latest Immich version from GitHub every 1 hour (not configurable for now).
WebUI changes :