We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description
It is my code
import 'dart:convert'; import 'dart:io'; import 'package:dart_frog/dart_frog.dart'; import 'package:http_parser/http_parser.dart'; import 'package:path/path.dart' as p; import 'package:http/http.dart' as http; import 'package:uuid/uuid.dart'; import '../main.dart'; Future<Response> onRequest(RequestContext context) async { try { final formDataRequest = await context.request.formData(); final fileUpload = formDataRequest.files.values.first.name; final timestamp = Uuid().v1(); final pathUp = p.join( Directory.current.path, 'imagesUp', timestamp.toString() + '.jpg'); final pathDown = p.join( Directory.current.path, 'imagesDown', timestamp.toString() + '.jpg'); final fbytes = await formDataRequest.files.values.first.readAsBytes(); await File(pathUp).writeAsBytes( fbytes, flush: true, ); print('upfile-ok'); return Response.bytes(body: []); } catch (e, s) { print('error- $e - $s'); return Response(statusCode: 500, body: e.toString() + s.toString()); } }
it performs the action of saving the image to the hard drive.
With 100 consecutive requests, each request uploading a 2.5MB image, the server will very quickly reach a RAM usage of about 4GB.
If the number of requests is 500 consecutive requests, the RAM usage will be more than 10GB.
The text was updated successfully, but these errors were encountered:
Hello @tbm98 ,
Do you experience this on dev server or prod server? Or both?
Sorry, something went wrong.
@renancaraujo I just run by dart_frog dev
@tbm98 what happens if you dont run the dev server?
No branches or pull requests
Description
It is my code
it performs the action of saving the image to the hard drive.
With 100 consecutive requests, each request uploading a 2.5MB image, the server will very quickly reach a RAM usage of about 4GB.
If the number of requests is 500 consecutive requests, the RAM usage will be more than 10GB.
The text was updated successfully, but these errors were encountered: