Use gevent sleep in mock camera
This commit is contained in:
parent
414be0405e
commit
d098af8858
1 changed files with 2 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ import time
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image, ImageFont, ImageDraw
|
from PIL import Image, ImageFont, ImageDraw
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
import gevent
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
@ -224,7 +225,7 @@ class MissingCamera(BaseCamera):
|
||||||
# While the iterator is not closed
|
# While the iterator is not closed
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
time.sleep(1) # Only serve frames at 1fps
|
gevent.sleep(1) # Only serve frames at 1fps
|
||||||
# Reset stream
|
# Reset stream
|
||||||
self.stream.seek(0)
|
self.stream.seek(0)
|
||||||
self.stream.truncate()
|
self.stream.truncate()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue