Skip to content

Commit

Permalink
RTSP Camera Agent: fix docker dependency and make copy for latest file (
Browse files Browse the repository at this point in the history
#800)

* fix docker dependency; copy latest file

* rename latest variable
  • Loading branch information
davidvng authored Dec 10, 2024
1 parent 38566db commit 7631d0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ WORKDIR /app/socs/
# Work around https://github.com/pypa/setuptools/issues/4483/ temporarily
RUN python -m pip install -U "setuptools<71.0.0"
RUN python -m pip install -r requirements.txt
RUN python -m pip uninstall -y opencv-python && \
python -m pip install opencv-python-headless

# Copy the current directory contents into the container at /app
COPY . /app/socs/
Expand Down
9 changes: 4 additions & 5 deletions socs/common/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import glob
import os
import re
import shutil
from collections import deque
from datetime import datetime, timezone

Expand Down Expand Up @@ -182,11 +183,9 @@ def store(self, data):
del buffer
self._deque[pos] = (file, None)

# Update latest symlink
link = os.path.join(self.dir, f"latest.{self.suffix}")
if os.path.exists(link):
os.remove(link)
os.symlink(path, link)
# Update latest copy
latest = os.path.join(self.dir, f"latest.{self.suffix}")
shutil.copy2(path, latest)

def fetch_recent(self):
result = list()
Expand Down

0 comments on commit 7631d0e

Please sign in to comment.