Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: web/inc/logdog-stream-view/model.ts

Issue 2989313002: [logdog] Stream view explicitly cancels request. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « web/inc/logdog-stream-view/fetcher.ts ('k') | web/inc/logdog-stream-view/query.ts » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 Copyright 2016 The LUCI Authors. All rights reserved. 2 Copyright 2016 The LUCI Authors. All rights reserved.
3 Use of this source code is governed under the Apache License, Version 2.0 3 Use of this source code is governed under the Apache License, Version 2.0
4 that can be found in the LICENSE file. 4 that can be found in the LICENSE file.
5 */ 5 */
6 6
7 ///<reference path="../logdog-stream/logdog.ts" /> 7 ///<reference path="../logdog-stream/logdog.ts" />
8 ///<reference path="../luci-operation/operation.ts" /> 8 ///<reference path="../luci-operation/operation.ts" />
9 ///<reference path="../luci-sleep-promise/promise.ts" /> 9 ///<reference path="../luci-sleep-promise/promise.ts" />
10 ///<reference path="../rpc/client.ts" /> 10 ///<reference path="../rpc/client.ts" />
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // 276 //
277 // If we failed due to an auth error, but our auth changed during the 277 // If we failed due to an auth error, but our auth changed during the
278 // operation, try again automatically. 278 // operation, try again automatically.
279 let query: LogDog.QueryRequest = { 279 let query: LogDog.QueryRequest = {
280 project: stream.project, 280 project: stream.project,
281 path: stream.path, 281 path: stream.path,
282 streamType: LogDog.StreamType.TEXT, 282 streamType: LogDog.StreamType.TEXT,
283 }; 283 };
284 284
285 while (true) { 285 while (true) {
286 let op = new luci.Operation();
286 try { 287 try {
287 let results = await LogDog.queryAll(this.client, query, 100); 288 let results = await LogDog.queryAll(op, this.client, query, 100);
288 return results.map(qr => qr.stream); 289 return results.map(qr => qr.stream);
289 } catch (err) { 290 } catch (err) {
290 err = resolveErr(err); 291 err = resolveErr(err);
291 if (err !== NOT_AUTHENTICATED) { 292 if (err !== NOT_AUTHENTICATED) {
292 throw err; 293 throw err;
293 } 294 }
294 295
295 await this.authChangedPromise; 296 await this.authChangedPromise;
296 } 297 }
297 } 298 }
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 1444
1444 // Get the next log and increment our index. 1445 // Get the next log and increment our index.
1445 let log = this.logs[this.index++]; 1446 let log = this.logs[this.index++];
1446 if (this.index >= this.logs.length) { 1447 if (this.index >= this.logs.length) {
1447 this.logs = null; 1448 this.logs = null;
1448 } 1449 }
1449 return log; 1450 return log;
1450 } 1451 }
1451 } 1452 }
1452 } 1453 }
OLDNEW
« no previous file with comments | « web/inc/logdog-stream-view/fetcher.ts ('k') | web/inc/logdog-stream-view/query.ts » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698