File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919from apps .shared .enums import CacheKey
2020from apps .shared .helpers import attach_default_email_images , attach_image_to_email
2121from apps .shared .models import Area
22- from apps .webcam .tasks import update_camera_nearby_objs
2322from django .conf import settings
2423from django .contrib .gis .geos import LineString , Point
2524from django .core .cache import cache
@@ -219,9 +218,6 @@ def populate_all_event_data():
219218 # Send notifications
220219 send_event_notifications (updated_event_ids )
221220
222- # Update nearby count for all cameras
223- update_camera_nearby_objs ()
224-
225221
226222def get_image_type_file_name (event ):
227223 major_delay_icon_map = {
Original file line number Diff line number Diff line change 1515 build_route_geometries ,
1616 populate_all_webcam_data ,
1717 update_all_webcam_data ,
18+ update_camera_nearby_objs ,
1819)
1920from apps .wildfire .tasks import populate_all_wildfire_data
2021from django .core .cache import cache
@@ -35,6 +36,12 @@ def update_camera_task():
3536 update_all_webcam_data ()
3637
3738
39+ @db_periodic_task (crontab (hour = "*/1" , minute = "0" ))
40+ @lock_task ('update-camera-nearby-lock' )
41+ def update_camera_nearby_objs_task ():
42+ update_camera_nearby_objs ()
43+
44+
3845@db_periodic_task (crontab (minute = "*/1" ))
3946@lock_task ('events-lock' )
4047def populate_event_task ():
You can’t perform that action at this time.
0 commit comments