提交 c0dd44ef 编写于 作者: A Alex Dima

Cache integrity computation

上级 b5fb75ea
......@@ -66,6 +66,7 @@ export class IntegrityServiceImpl implements IIntegrityService {
private _messageService: IMessageService;
private _storage:IntegrityStorage;
private _loaderChecksums: ILoaderChecksums;
private _isPurePromise: TPromise<IntegrityTestResult>;
constructor(
@IMessageService messageService: IMessageService,
......@@ -84,6 +85,8 @@ export class IntegrityServiceImpl implements IIntegrityService {
this._loaderChecksums[scriptUri.toString()] = loaderChecksums[scriptSrc];
});
this._isPurePromise = this._isPure();
this.isPure().then(r => {
if (r.isPure) {
// all is good
......@@ -127,6 +130,10 @@ export class IntegrityServiceImpl implements IIntegrityService {
}
public isPure(): TPromise<IntegrityTestResult> {
return this._isPurePromise;
}
private _isPure(): TPromise<IntegrityTestResult> {
const expectedChecksums = product.checksums || {};
let syncResults: ChecksumPair[] = [];
let asyncResults: TPromise<ChecksumPair>[] = [];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册