Skip to content

Commit 3caa167

Browse files
Michael BüßemeyerMichael Büßemeyer
authored andcommitted
add debug logging to handleUploadChunk
1 parent 044bcd2 commit 3caa167

File tree

1 file changed

+9
-2
lines changed
  • webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/uploading

1 file changed

+9
-2
lines changed

webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/uploading/UploadService.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,20 @@ class UploadService @Inject()(dataSourceRepository: DataSourceRepository,
257257
(filePath, uploadDir) <- getFilePathAndDirOfUploadId(uploadFileId)
258258
isFileKnown <- runningUploadMetadataStore.contains(redisKeyForFileChunkCount(uploadId, filePath))
259259
totalFileSizeInBytesOpt <- runningUploadMetadataStore.findLong(redisKeyForTotalFileSizeInBytes(uploadId))
260+
_ = println(s"----------------------------------------------------------------\nreceived $chunkSize bytes")
260261
_ <- Fox.runOptional(totalFileSizeInBytesOpt) { maxFileSize =>
261262
runningUploadMetadataStore
262263
.increaseBy(redisKeyForCurrentUploadedTotalFileSizeInBytes(uploadId), chunkSize)
263264
.flatMap(newTotalFileSizeInBytesOpt => {
265+
val exceedsSize = newTotalFileSizeInBytesOpt.getOrElse(0L) > maxFileSize
266+
println(s"newTotalFileSizeInBytesOpt: $newTotalFileSizeInBytesOpt Exceeds Size: $exceedsSize")
267+
println(
268+
s"uploadFileId: $uploadFileId,totalChunkCount: $totalChunkCount, currentChunkNumber: $currentChunkNumber, chunkFile: $chunkFile")
269+
println("----------------------------------------------------------------")
264270
if (newTotalFileSizeInBytesOpt.getOrElse(0L) > maxFileSize) {
265-
cleanUpDatasetExceedingSize(uploadDir, uploadId).flatMap(_ =>
266-
Fox.failure("dataset.upload.moreBytesThanReserved"))
271+
Fox.successful(())
272+
/*cleanUpDatasetExceedingSize(uploadDir, uploadId).flatMap(_ =>
273+
Fox.failure("dataset.upload.moreBytesThanReserved"))*/
267274
} else {
268275
Fox.successful(())
269276
}

0 commit comments

Comments
 (0)