Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTSP Camera Agent: fix docker dependency and make copy for latest file #800

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 3 additions & 2 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,11 @@ def store(self, data):
del buffer
self._deque[pos] = (file, None)

# Update latest symlink
# Update latest copy
link = os.path.join(self.dir, f"latest.{self.suffix}")
if os.path.exists(link):
os.remove(link)
os.symlink(path, link)
shutil.copy2(path, link)
BrianJKoopman marked this conversation as resolved.
Show resolved Hide resolved

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