Skip to content

Commit

Permalink
fix(README.md + cache_service): Update last_seen
Browse files Browse the repository at this point in the history
Added missing last_seen update to datetime.utcnow() for each agent and
camera. Last seen column was not updating.
Fixed some formatting in
README.md
  • Loading branch information
mibs510 committed Jul 12, 2023
1 parent 2067c1c commit 4263822
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,14 @@ WantedBy=multi-user.target

Be sure to modify `User`, `WorkingDirectory`, and `ExecStart`.

`User` should not have root privileges without invoking sudo!
> ⚠️ `User` should not have root privileges without invoking sudo!
Then execute:

`sudo systemctl daemon-reload`

`sudo systemctl enable oalpr-wh`

`sudo systemctl start oalpr-wh`

```shell
sudo systemctl daemon-reload
sudo systemctl enable oalpr-wh
sudo systemctl start oalpr-wh
```
Optional: `journalctl -n 50 -f`

### New Instance
Expand Down
2 changes: 2 additions & 0 deletions apps/api/service/cache_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def update(self):
else:
# Always overwrite the label, it may have changed
agent_uid.agent_label = self.request['web_server_config']['agent_label']
agent_uid.last_seen = datetime.utcnow()
agent_uid.save()

# Cameras
Expand All @@ -107,6 +108,7 @@ def update(self):
else:
# Always overwrite the label, it may have changed
camera_id.camera_label = self.request['web_server_config']['camera_label']
camera_id.last_seen = datetime.utcnow()
camera_id.save()

# Check to see if we need to send an alert
Expand Down

0 comments on commit 4263822

Please sign in to comment.