-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework load status and add failover implementation #585
Conversation
After failover to production we need to decide on how we want to handle a potential high load in the production backend. Shall we switch to release again? Shall we stay at production? Shall we restrict app access? |
lib/home/services/load.dart
Outdated
import 'package:priobike/http.dart'; | ||
import 'package:priobike/logging/logger.dart'; | ||
import 'package:priobike/main.dart'; | ||
import 'package:priobike/settings/models/backend.dart'; | ||
import 'package:priobike/settings/services/settings.dart'; | ||
|
||
// TODO maybe send these values from the load service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also argue for that. Setting those values on the client makes it harder for us to update them and I don't see an advantage in setting them on the client instead of at the load service.
Furthermore, do we need the actual load values on the client or would it also be enough to just send a bool to the client stating whether our backend is overloaded right now or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree. I just wanted your confirmation on that before implementing it.
lib/home/services/load.dart
Outdated
/// Sends an app start notification to the load service in the backend. | ||
Future<void> sendAppStartNotification() async { | ||
/// Fetches the status data from the priobike-load-service for release and production and decides whether the failover (production) should be used. | ||
Future<bool> shouldUseFailover() async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both the fetch()
and the shouldUseFailover
methods?
lib/loader.dart
Outdated
await FCM.selectTopic(settings.backend); | ||
} else { | ||
await settings.setBackend(Backend.release); | ||
await FCM.selectTopic(settings.backend); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make more sense to keep the News Service and FCM always in Release mode. If they are not reachable because of overloading its not that problematic. Production and Release, however, diverge content-wise and therefore are not easily interchangeable.
Continued here: #613 |
If available, link to the ticket
Closes: #561
Closes: #562
QA Checklist
Author
Reviewer