mirror of
https://github.com/fastogt/fastocloud_admin.git
synced 2025-03-09 23:38:52 +00:00
Sync pyfastocloud
This commit is contained in:
parent
df6cf26ff4
commit
192c47f979
2 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
from app.common.subscriber.entry import Subscriber, Device
|
from app.common.subscriber.entry import Subscriber, Device
|
||||||
from pyfastocloud.subscriber_client import SubscriberClient
|
from pyfastocloud.subscriber_client import SubscriberClient
|
||||||
from pyfastocloud.client import make_utc_timestamp
|
from pyfastocloud.client import make_utc_timestamp_seconds
|
||||||
import pyfastocloud.socket.gevent as gsocket
|
import pyfastocloud.socket.gevent as gsocket
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ class SubscriberConnection(SubscriberClient):
|
||||||
self._info = None
|
self._info = None
|
||||||
self._current_stream_id = str()
|
self._current_stream_id = str()
|
||||||
self._device = None
|
self._device = None
|
||||||
self._last_ping_ts = make_utc_timestamp() / 1000
|
self._last_ping_ts = make_utc_timestamp_seconds()
|
||||||
self._request_id = 0
|
self._request_id = 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -6,7 +6,7 @@ from app.service.subscriber_client import SubscriberConnection
|
||||||
from app.common.subscriber.entry import Subscriber, Device
|
from app.common.subscriber.entry import Subscriber, Device
|
||||||
from app.common.constants import PlayerMessage
|
from app.common.constants import PlayerMessage
|
||||||
from pyfastocloud.subscriber_client import Commands
|
from pyfastocloud.subscriber_client import Commands
|
||||||
from pyfastocloud.client import make_utc_timestamp
|
from pyfastocloud.client import make_utc_timestamp_seconds
|
||||||
from pyfastocloud.client_handler import IClientHandler, Request, Response, ClientStatus
|
from pyfastocloud.client_handler import IClientHandler, Request, Response, ClientStatus
|
||||||
import pyfastocloud.socket.gevent as gsocket
|
import pyfastocloud.socket.gevent as gsocket
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class SubscribersServiceManager(ServiceManager, IClientHandler):
|
||||||
server.recv_data()
|
server.recv_data()
|
||||||
break
|
break
|
||||||
|
|
||||||
ts_sec = make_utc_timestamp() / 1000
|
ts_sec = make_utc_timestamp_seconds()
|
||||||
copy_subsc = list(self._subscribers)
|
copy_subsc = list(self._subscribers)
|
||||||
for client in copy_subsc:
|
for client in copy_subsc:
|
||||||
if ts_sec - client.last_ping_ts > SubscribersServiceManager.PING_SUBSCRIBERS_SEC:
|
if ts_sec - client.last_ping_ts > SubscribersServiceManager.PING_SUBSCRIBERS_SEC:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue