Fixed production analyze warnings

This commit is contained in:
thomashii@dukefirehawk.com 2022-08-27 17:23:41 +08:00
parent ba247bd388
commit 52a3a3a3ab
2 changed files with 13 additions and 17 deletions

View file

@ -119,9 +119,9 @@ _ ___ | /| / / /_/ / _ /___ _ /___
var onLogRecord = ReceivePort();
var onExit = ReceivePort();
var onError = ReceivePort();
var runnerArgs = _RunnerArgs(name, configureServer, options, reflector,
var runnerArgs = RunnerArgs(name, configureServer, options, reflector,
onLogRecord.sendPort, pubSubSendPort);
var argsWithId = _RunnerArgsWithId(id, runnerArgs);
var argsWithId = RunnerArgsWithId(id, runnerArgs);
Isolate.spawn(isolateMain, argsWithId,
onExit: onExit.sendPort,
@ -187,11 +187,8 @@ _ ___ | /| / / /_/ / _ /___ _ /___
}
}
print(darkGray.wrap(asciiArt +
'\n\n' +
'A batteries-included, full-featured, full-stack framework in Dart.' +
'\n\n' +
'https://angel3-framework.web.app\n'));
print(darkGray.wrap(
'$asciiArt\n\nA batteries-included, full-featured, full-stack framework in Dart.\n\nhttps://angel3-framework.web.app\n'));
if (argResults['help'] == true) {
stdout
@ -232,7 +229,7 @@ _ ___ | /| / / /_/ / _ /___ _ /___
}
/// Run with main isolate
static void isolateMain(_RunnerArgsWithId argsWithId) {
static void isolateMain(RunnerArgsWithId argsWithId) {
var args = argsWithId.args;
hierarchicalLoggingEnabled = false;
@ -304,14 +301,14 @@ _ ___ | /| / / /_/ / _ /___ _ /___
}
}
class _RunnerArgsWithId {
class RunnerArgsWithId {
final int id;
final _RunnerArgs args;
final RunnerArgs args;
_RunnerArgsWithId(this.id, this.args);
RunnerArgsWithId(this.id, this.args);
}
class _RunnerArgs {
class RunnerArgs {
final String name;
final AngelConfigurer configureServer;
@ -322,7 +319,7 @@ class _RunnerArgs {
final SendPort loggingSendPort, pubSubSendPort;
_RunnerArgs(this.name, this.configureServer, this.options, this.reflector,
RunnerArgs(this.name, this.configureServer, this.options, this.reflector,
this.loggingSendPort, this.pubSubSendPort);
String get loggerName => name;

View file

@ -22,7 +22,7 @@ void main() {
testApp!.get('/empty', (req, res) => res.close());
testApp!.responseFinalizers.add((req, res) async {
print('OUTGOING: ' + String.fromCharCodes(res.buffer!.toBytes()));
print('OUTGOING: ${String.fromCharCodes(res.buffer!.toBytes())}');
});
testApp!.encoders.addAll({'gzip': gzip.encoder});
@ -44,9 +44,8 @@ void main() {
app!.fallback(layer.handleRequest);
app!.responseFinalizers.add((req, res) async {
print('Normal. Buf: ' +
String.fromCharCodes(res.buffer!.toBytes()) +
', headers: ${res.headers}');
print(
'Normal. Buf: ${String.fromCharCodes(res.buffer!.toBytes())}, headers: ${res.headers}');
});
app!.encoders.addAll({'gzip': gzip.encoder});