Skip to content

Commit

Permalink
Add comment about tmp path
Browse files Browse the repository at this point in the history
  • Loading branch information
finestructure committed Jul 11, 2024
1 parent 344a878 commit 91d2f35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/DocUploader/DocUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public struct DocUploader: LambdaHandler {
logger.info("record: \(record)")

try await run {
// When Lambdas are run in quick succession they seem to be seeing the same /tmp file system and unzipping can fail with
// lambda handler returned an error: Error Domain=NSCocoaErrorDomain Code=516 "A file with the same name already exists."
let outputPath = "/tmp/\(UUID())"
try Foundation.FileManager.default.createDirectory(at: URL(fileURLWithPath: outputPath), withIntermediateDirectories: true)

Expand Down

0 comments on commit 91d2f35

Please sign in to comment.