Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Change docStatus to invalidate entry when TU update
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Aug 8, 2013
1 parent 9afebcd commit b64b638
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -132,17 +132,23 @@ public void destroy()
@Override
public void textFlowStateUpdated(TextFlowTargetStateEvent event)
{
// updateDocStatusCache(event.getDocumentId(), event.getLocaleId(), event.getTextFlowTargetId());

// TODO update this cache rather than invalidating
invalidateDocLastTranslatedCache(event.getDocumentId(), event.getLocaleId());
invalidateTargetValidationCache(event.getTextFlowTargetId());

updateDocStatusCache(event.getDocumentId(), event.getLocaleId(), event.getTextFlowTargetId());
}

@Override
public DocumentStatus getDocumentStatus(Long documentId, LocaleId localeId)
{
return docStatusCache.getWithLoader(new TranslatedDocumentKey(documentId, localeId));
}

private void invalidateDocLastTranslatedCache(Long documentId, LocaleId localeId)
{
docStatusCache.remove(new TranslatedDocumentKey(documentId, localeId));
}

@Override
public Boolean textFlowTargetHasError(Long targetId, ValidationId validationId)
Expand Down

0 comments on commit b64b638

Please sign in to comment.