mirror of
https://github.com/kennethnym/freya
synced 2026-06-26 19:31:17 +01:00
feat(backend): make FeedSourceProvider async
Make feedSourceForUser and FeedSourceProviderFn return promises. Use Promise.allSettled to tolerate partial provider failures. Guard concurrent getOrCreate calls with in-flight promise dedup. Return 503 from HTTP handlers when session creation fails. Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -9,7 +9,7 @@ export class WeatherSourceProvider implements FeedSourceProvider {
|
||||
this.options = options
|
||||
}
|
||||
|
||||
feedSourceForUser(_userId: string): WeatherSource {
|
||||
async feedSourceForUser(_userId: string): Promise<WeatherSource> {
|
||||
return new WeatherSource(this.options)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user