Skip to content

Commit

Permalink
turned on logging for aws dynamo and ibgibs service
Browse files Browse the repository at this point in the history
* just checking in because i'm about to branch for a version update
  • Loading branch information
wraiford committed Mar 28, 2022
1 parent 3951a20 commit 3c83591
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import { getGib } from 'ts-gib/dist/V1/transforms/transform-helper';

// #endregion imports

const logalot = c.GLOBAL_LOG_A_LOT || false;
const logalot = c.GLOBAL_LOG_A_LOT || false || true;

// #region AWS related

Expand Down Expand Up @@ -2048,12 +2048,13 @@ export class AWSDynamoSpace_V1<

// Do the tjp part, this mutates resLatestMap
if (tjpIbGibs?.length > 0) {
if (logalot) { console.log(`${lc} checking latest addr for ibgibs with tjps (timelines)... (I: e92e6a0c05fce1849f005f0ceaf4c122)`); }
await this.getLatestIbGibAddrsInStore_Tjp({
client, warnings, errors,
tjpIbGibs, ibGibsWithTjpGroupedByTjpAddr, resLatestMap
});

if (logalot) { console.log(`${lc} resLatestMap: ${h.pretty(resLatestMap)}`); }
if (logalot) { console.log(`${lc} check complete. resLatestMap: ${h.pretty(resLatestMap)} (I: 2121f39c2af647989e1d54dcf500e6f0)`); }

// at this point, resLatestMap should have mappings for all incoming
// ibgibs with tjps, including any tjps proper (n=0).
Expand All @@ -2064,10 +2065,12 @@ export class AWSDynamoSpace_V1<

// Do the non-tjp part, this mutates resLatestMap
if (ibGibsWithoutTjp.length > 0) {
if (logalot) { console.log(`${lc} now doing non-tjp ibgibs (check if e.g. a fork transform exists in store)... (I: 1228a5a70063e33d14b3f69e3d5eab22)`); }
await this.getLatestIbGibAddrsInStore_NonTjp({
client, warnings, errors,
ibGibsWithoutTjp, resLatestMap
});
if (logalot) { console.log(`${lc} non-tjp ibgibs complete. (I: 853dda4633adce528c4afdef26963b22)`); }
}

// at this point, our resLatestMap should be completely filled for
Expand Down
7 changes: 5 additions & 2 deletions ionic-gib/src/app/services/ibgibs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import {
} from '../common/types/legacy';
import { concatMap, } from 'rxjs/operators';

const logalot = c.GLOBAL_LOG_A_LOT || false;
const logalot = c.GLOBAL_LOG_A_LOT || false || true;

interface TempCacheEntry {
/**
Expand Down Expand Up @@ -1935,7 +1935,10 @@ export class IbgibsService {
// map of saga infos across all spaces
// const sagaInfoMap: { [spaceGib: string]: SyncSagaInfo } = {};
try {
if (this.syncing) { throw new Error(`already syncing. (E: dfa3ad58e97f4b18b4e4d7dc252208fb)`); }
if (this.syncing) {
if (logalot) { console.warn(`already syncing. (E: dfa3ad58e97f4b18b4e4d7dc252208fb)`); }
return;
}
if (Object.values(this.sagaInfoMap).length > 0) { throw new Error(`this._syncing is false but sagaInfoMap not cleaned up(?). (E: bb69c808877c4931b5481585043c18e7)(UNEXPECTED)`); }

this._syncing = true;
Expand Down

0 comments on commit 3c83591

Please sign in to comment.