Realtime status
Features
Websocket
Clients can subscribe to websocket channel which sends information about instance status changes.
URI:
ws://{BASE_URL}/ws/instance-statuses
This queries messages for vms which belongs to the user.
Celery
Includes celery.py for background tasks
Celery-beat package for running scheduler for periodic tasks.
Running periodic tasks:
celery -A recircle worker -B -l INFO
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
-
Toggle commit list
-
marked as a Work In Progress
Toggle commit list -
changed the description
Toggle commit list -
251 254 252 255 def update_status(self): 253 256 remote = self.get_remote_instance() 254 self.status = remote.status 255 self.save() 257 if self.status != remote.status: 258 self.status = remote.status 259 channels = get_channel_layer() 260 async_to_sync(channels.group_send)( -
Owner
ez miért kell?
-
Master
Mi?
-
-
251 254 252 255 def update_status(self): 253 256 remote = self.get_remote_instance() 254 self.status = remote.status 255 self.save() 257 if self.status != remote.status: 258 self.status = remote.status 259 channels = get_channel_layer() 260 async_to_sync(channels.group_send)( 261 str(self.id), {"type": "status_changed", 262 "status": self.status, 263 "vm": str(self.id) -
Owner
Itt miért kell az str?
-
Master
Hogy string legyen
😸
-
-
recircle/recircle/routing.py 0 → 100644
1 from channels.auth import AuthMiddlewareStack 2 from channels.routing import ProtocolTypeRouter, URLRouter 3 import status.routing 4 5 application = ProtocolTypeRouter({ 6 # Empty for now (http->django views is added by default) 7 'websocket': AuthMiddlewareStack( -
Owner
Az AuthMiddlewareStack az mi?
-
-
unmarked as a Work In Progress
Toggle commit list -
merged
Toggle commit list -