Skip to content

Commit 7af40c9

Browse files
committed
Log actual count of uploads.
1 parent 69214bd commit 7af40c9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

data/store/mongo/mongo_data_set.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,14 @@ func (d *DataSetRepository) GetDataSetsForUserByID(ctx context.Context, userID s
323323
SetSort(bson.M{"createdTime": -1})
324324
cursor, err := d.Find(ctx, selector, opts)
325325

326-
loggerFields := log.Fields{"userId": userID, "dataSetsCount": len(dataSets), "duration": time.Since(now) / time.Microsecond}
327-
log.LoggerFromContext(ctx).WithFields(loggerFields).WithError(err).Debug("GetDataSetsForUserByID")
328-
329326
if err != nil {
330327
return nil, errors.Wrap(err, "unable to get data sets for user by id")
331328
}
332329

333-
if err = cursor.All(ctx, &dataSets); err != nil {
330+
err = cursor.All(ctx, &dataSets)
331+
loggerFields := log.Fields{"userId": userID, "dataSetsCount": len(dataSets), "duration": time.Since(now) / time.Microsecond}
332+
log.LoggerFromContext(ctx).WithFields(loggerFields).WithError(err).Debug("GetDataSetsForUserByID")
333+
if err != nil {
334334
return nil, errors.Wrap(err, "unable to decode data sets for user by id")
335335
}
336336

0 commit comments

Comments
 (0)