Skip to content

Commit

Permalink
feat(neon_framework): Allow getting http.Request async in RequestManager
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Oct 9, 2024
1 parent 9692c52 commit 605f533
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/neon_framework/lib/src/utils/request_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class RequestManager {
Future<void> wrap<T, R>({
required Account account,
required BehaviorSubject<Result<T>> subject,
required http.Request Function() getRequest,
required FutureOr<http.Request> Function() getRequest,
required Converter<http.Response, R> converter,
required UnwrapCallback<T, R> unwrap,
AsyncValueGetter<Map<String, String>>? getCacheHeaders,
Expand All @@ -83,7 +83,7 @@ class RequestManager {
subject.add(Result.loading());
}

var request = getRequest();
var request = await getRequest();

final cachedResponse = await _cache?.get(account, request);
if (subject.isClosed) {
Expand Down Expand Up @@ -216,7 +216,7 @@ class RequestManager {
break;
}

request = getRequest();
request = await getRequest();

_log.info(
'Error while executing the request. Retrying ...',
Expand Down

0 comments on commit 605f533

Please sign in to comment.