Skip to content

Commit

Permalink
Update PrintJobHistoryAPI.py to fix GET of thumbnails that broke arou…
Browse files Browse the repository at this point in the history
…nd Octoprint 1.9 timeframe

removed outdated cache_timeout and replaced with max_age, set to 1 day (86400 seconds) but whatever makes sense is good there if you wanted to change it.
  • Loading branch information
dojohnso authored May 25, 2023
1 parent eb49a95 commit 1d86931
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion octoprint_PrintJobHistory/api/PrintJobHistoryAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def put_forceCloseEditDialog(self):
@octoprint.plugin.BlueprintPlugin.route("/printJobSnapshot/<string:snapshotFilename>", methods=["GET"])
def get_snapshot(self, snapshotFilename):
absoluteFilename = self._cameraManager.buildSnapshotFilenameLocation(snapshotFilename)
return send_file(absoluteFilename, mimetype='image/jpg', cache_timeout=1)
return send_file(absoluteFilename, mimetype='image/jpg', max_age=86400)

####################################################################################### TAKE SNAPSHOT
@octoprint.plugin.BlueprintPlugin.route("/takeSnapshot/<string:snapshotFilename>", methods=["PUT"])
Expand Down

1 comment on commit 1d86931

@HAndreasH
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

Please sign in to comment.