message: Use try finally to make sure the imodeldb objects are closed during change summary extraction
diff: @@ -57,12 +57,12 @@ export class ChangeSummaryManager {
  if (nativeIModelDb == null)
  throw new IModelError(IModelStatus.WrongIModel);
  + try {
  +
  if (ChangeSummaryManager.isSummaryAlreadyExtracted(changesFile, changeSet.wsgId)) {
  - await iModel.close(accessToken);
  continue;
  }
  - try {
  const changeSetFilePath: string = path.join(changeSetsFolder, changeSet.fileName);
  const stat: ErrorStatusOrResult<DbResult, string> = nativeIModelDb.extractChangeSummary(changesFile.nativeDb, changeSetFilePath);
  if (stat.error != null && stat.error!.status !== DbResult.BE_SQLITE_OK)
  @@ -79,11 +79,8 @@ export class ChangeSummaryManager {
  }
  ChangeSummaryManager.addExtendedInfos(changesFile, changeSummaryId, new ChangeSummaryExtendedInfo(changeSet.wsgId, changeSet.pushDate, userEmail, changeSet.parentId));
  -
  - await iModel.close(accessToken);
  - } catch (e) {
  + } finally {
  await iModel.close(accessToken);
  - throw e;
  }
  }
  @@ -105,12 +102,10 @@ export class ChangeSummaryManager {
  try {
  iModel.createChangeCache(changesFile, changesPath);
  - await iModel.close(accessToken);
  return changesFile;
  - } catch (e) {
  + } finally {
  await iModel.close(accessToken);
  - throw e;
  }
  }
  