Skip to content

Commit

Permalink
Workaround Response being multi-threaded while SQLite does not suppor…
Browse files Browse the repository at this point in the history
…t multi-threading, leading to failure of requests that use database connections. Fixes dojohnso#47
  • Loading branch information
WildRikku committed Sep 11, 2024
1 parent c2d52c7 commit c8e8a31
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion octoprint_SpoolManager/api/SpoolManagerAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,11 @@ def exportSpoolsData(self, exportType):
currentDate = now.strftime("%Y%m%d-%H%M")
fileName = "SpoolManager-" + currentDate + ".csv"

return Response(CSVExportImporter.transform2CSV(allSpoolModels),
csv = []
for csvline in CSVExportImporter.transform2CSV(allSpoolModels):
csv.append(csvline)

return Response(csv,
mimetype='text/csv',
headers={'Content-Disposition': 'attachment; filename=' + fileName})

Expand Down

0 comments on commit c8e8a31

Please sign in to comment.