Skip to content

Commit 19b48b6

Browse files
committed
Revert "Merge pull request #64 from systemetric/lock-image"
This reverts commit 9923f44, reversing changes made to 9db7c3e.
1 parent 9923f44 commit 19b48b6

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

shepherd/blueprints/run/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import json
77
import os
88
import sys
9-
from fcntl import lockf, LOCK_EX, LOCK_UN
109
from enum import Enum
1110

1211
from flask import Blueprint, redirect, url_for, request, session, send_file
@@ -52,14 +51,7 @@ def toggle_auto_refresh():
5251

5352
@blueprint.route("/picture")
5453
def get_picture():
55-
try:
56-
f = os.open("/home/pi/shepherd/shepherd/static/image.jpg", os.O_RDWR)
57-
lockf(f, LOCK_EX)
58-
return send_file("/home/pi/shepherd/shepherd/static/image.jpg", mimetype="image/jpeg")
59-
finally:
60-
if "f" in locals():
61-
lockf(f, LOCK_UN)
62-
os.close(f)
54+
return send_file("/home/pi/shepherd/shepherd/static/image.jpg", mimetype="image/jpeg")
6355

6456
@blueprint.route("/start", methods=["POST"])
6557
def start():

0 commit comments

Comments
 (0)