mirror of
https://git.wownero.com/wowlet/wowlet-backend.git
synced 2024-08-15 01:03:13 +00:00
Initial support for a trollbox
This commit is contained in:
parent
e79059820f
commit
0619522bb1
6 changed files with 104 additions and 12 deletions
|
@ -39,7 +39,7 @@ class WowletTask:
|
|||
self._running = False
|
||||
|
||||
async def start(self, *args, **kwargs):
|
||||
from wowlet_backend.factory import app, connected_websockets
|
||||
from wowlet_backend.factory import app, broadcast
|
||||
if not self._active:
|
||||
# invalid task
|
||||
return
|
||||
|
@ -94,11 +94,10 @@ class WowletTask:
|
|||
propagate = False
|
||||
|
||||
if propagate:
|
||||
for queue in connected_websockets:
|
||||
await queue.put({
|
||||
"cmd": self._websocket_cmd,
|
||||
"data": result
|
||||
})
|
||||
await broadcast.put({
|
||||
"cmd": self._websocket_cmd,
|
||||
"data": result
|
||||
})
|
||||
|
||||
# optional: cache the result
|
||||
if self._cache_key and result:
|
||||
|
@ -167,4 +166,4 @@ from wowlet_backend.tasks.rpc_nodes import RPCNodeCheckTask
|
|||
from wowlet_backend.tasks.xmrig import XmrigTask
|
||||
from wowlet_backend.tasks.suchwow import SuchWowTask
|
||||
from wowlet_backend.tasks.wowlet import WowletReleasesTask
|
||||
from wowlet_backend.tasks.forum import ForumThreadsTask
|
||||
from wowlet_backend.tasks.forum import ForumThreadsTask
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue