Skip to content

Commit

Permalink
Merge pull request #111 from dlarson04/Issue_110
Browse files Browse the repository at this point in the history
Issue 110 - CSS delete temp data
  • Loading branch information
linggao authored Apr 12, 2022
2 parents 1edc3d4 + 273ab9f commit 3b79c8d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/storage/mongoStorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ func (store *MongoStorage) RetrieveObjectTempData(orgID string, objectType strin
if trace.IsLogging(logger.TRACE) {
trace.Trace(fmt.Sprintf("RetrieveObjectTempData for org - %s, type - %s, id - %s", orgID, objectType, objectID))
}
var readers []io.Reader
readers := make([]io.Reader, 0)
metaData, err := store.RetrieveObject(orgID, objectType, objectID)
if err != nil || metaData == nil {
return nil, &Error{fmt.Sprintf("Error in retrieving object metadata.\n")}
Expand Down Expand Up @@ -1446,7 +1446,13 @@ func (store *MongoStorage) DeleteStoredObject(orgID string, objectType string, o
func (store *MongoStorage) DeleteStoredData(orgID string, objectType string, objectID string, isTempData bool) common.SyncServiceError {
var id string
if isTempData {
return store.RemoveObjectTempData(orgID, objectType, objectID)
// Make sure we have all the temp data by calling RetrieveObjectTempData here
_,err := store.RetrieveObjectTempData(orgID, objectType, objectID)
if err == nil {
return store.RemoveObjectTempData(orgID, objectType, objectID)
} else {
return err
}
} else {
id = createObjectCollectionID(orgID, objectType, objectID)
if trace.IsLogging(logger.TRACE) {
Expand Down

0 comments on commit 3b79c8d

Please sign in to comment.