Skip to content

Commit

Permalink
Issue #SB-17385 merge: Merge pull request #276 from raghav14/release-…
Browse files Browse the repository at this point in the history
…2.7.0

Issue #SB-17385 fix: promises fix and delay added in endevent
  • Loading branch information
swayangjit authored Jan 24, 2020
2 parents fb0bd41 + d740f62 commit 033164b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/course/handlers/sync-assessment-events-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class SyncAssessmentEventsHandler {
const context = JSON.parse(key);
this.capturedAssessmentEvents[key]!.forEach((event) => {
if (context.batchStatus !== 2) {
this.persistAssessEvent(event, context);
this.persistAssessEvent(event, context).toPromise();
}
});
});
Expand Down Expand Up @@ -193,7 +193,7 @@ export class SyncAssessmentEventsHandler {
return this.invokeSyncApi(assessmentTelemetrySyncRequest);
}),
tap(async () =>
await this.dbService.execute(`DELETE FROM ${CourseAssessmentEntry.TABLE_NAME}`)
await this.dbService.execute(`DELETE FROM ${CourseAssessmentEntry.TABLE_NAME}`).toPromise()
),
mapTo(undefined)
).toPromise();
Expand Down
3 changes: 2 additions & 1 deletion src/summarizer/handler/summary-telemetry-event-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {ContentAccess, ContentAccessStatus, ProfileService} from '../../profile'
import {ArrayUtil} from '../../util/array-util';
import {DbService} from '../../db';
import {Observable, of} from 'rxjs';
import {map, mapTo, mergeMap, tap} from 'rxjs/operators';
import {map, mapTo, mergeMap, tap, delay} from 'rxjs/operators';

export class SummaryTelemetryEventHandler implements ApiRequestHandler<Telemetry, undefined> {
private static readonly CONTENT_PLAYER_PID = 'contentplayer';
Expand Down Expand Up @@ -142,6 +142,7 @@ export class SummaryTelemetryEventHandler implements ApiRequestHandler<Telemetry
contentId: identifier
};
return this.contentService.getContentDetails(request).pipe(
delay(2000),
map((content: Content) => {
const playerSummary: Array<any> = event.edata['summary'];
const contentMimeType = content.mimeType;
Expand Down

0 comments on commit 033164b

Please sign in to comment.