@@ -27,12 +27,6 @@ Future<void> main(List<String> args) async {
27
27
final parser = ArgParser ()
28
28
..addOption ('port' , valueHelp: 'port' , help: 'The port to listen on.' )
29
29
..addOption ('redis-url' , valueHelp: 'url' , help: 'The redis server url.' )
30
- ..addOption (
31
- 'storage-bucket' ,
32
- valueHelp: 'name' ,
33
- help: 'The name of the Cloud Storage bucket for compilation artifacts.' ,
34
- defaultsTo: 'nnbd_artifacts' ,
35
- )
36
30
..addFlag (
37
31
'help' ,
38
32
abbr: 'h' ,
@@ -68,8 +62,6 @@ Future<void> main(List<String> args) async {
68
62
emitLogsToStdout ();
69
63
70
64
final redisServerUri = results['redis-url' ] as String ? ;
71
- final storageBucket =
72
- results['storage-bucket' ] as String ? ?? 'nnbd_artifacts' ;
73
65
74
66
final cloudRunEnvVars = Platform .environment.entries
75
67
.where ((entry) => entry.key.startsWith ('K_' ))
@@ -89,8 +81,7 @@ Starting dart-services:
89
81
final server = await EndpointsServer .serve (
90
82
port,
91
83
sdk,
92
- redisServerUri,
93
- storageBucket,
84
+ redisServerUri: redisServerUri,
94
85
);
95
86
96
87
_logger.genericInfo ('Listening on port ${server .port }' );
@@ -99,15 +90,10 @@ Starting dart-services:
99
90
class EndpointsServer {
100
91
static Future <EndpointsServer > serve (
101
92
int port,
102
- Sdk sdk,
103
- String ? redisServerUri,
104
- String storageBucket,
105
- ) async {
106
- final endpointsServer = EndpointsServer ._(
107
- sdk,
108
- redisServerUri,
109
- storageBucket,
110
- );
93
+ Sdk sdk, {
94
+ required String ? redisServerUri,
95
+ }) async {
96
+ final endpointsServer = EndpointsServer ._(sdk, redisServerUri);
111
97
await endpointsServer._init ();
112
98
113
99
endpointsServer.server = await shelf.serve (
@@ -125,7 +111,7 @@ class EndpointsServer {
125
111
126
112
late final CommonServerApi commonServer;
127
113
128
- EndpointsServer ._(Sdk sdk, String ? redisServerUri, String storageBucket ) {
114
+ EndpointsServer ._(Sdk sdk, String ? redisServerUri) {
129
115
// The name of the Cloud Run revision being run, for more detail please see:
130
116
// https://cloud.google.com/run/docs/reference/container-contract#env-vars
131
117
final serverVersion = Platform .environment['K_REVISION' ];
@@ -134,9 +120,7 @@ class EndpointsServer {
134
120
? NoopCache ()
135
121
: RedisCache (redisServerUri, sdk, serverVersion);
136
122
137
- commonServer = CommonServerApi (
138
- CommonServerImpl (sdk, cache, storageBucket: storageBucket),
139
- );
123
+ commonServer = CommonServerApi (CommonServerImpl (sdk, cache));
140
124
141
125
final pipeline = const Pipeline ()
142
126
.addMiddleware (logRequestsToLogger (_logger))
@@ -196,7 +180,7 @@ class TestServerRunner {
196
180
197
181
_started = Completer <void >();
198
182
try {
199
- await EndpointsServer .serve (_port, sdk, null , 'nnbd_artifacts' );
183
+ await EndpointsServer .serve (_port, sdk, redisServerUri : null );
200
184
} on SocketException {
201
185
// This is expected if the server is already running.
202
186
}
0 commit comments