vpn integration
This commit is contained in:
+8
-10
@@ -1,12 +1,10 @@
|
||||
from django.db import close_old_connections
|
||||
from celery import shared_task
|
||||
from channels.layers import get_channel_layer
|
||||
from asgiref.sync import async_to_sync
|
||||
|
||||
from .models import Torrent, File
|
||||
from .utils import transmission_handler
|
||||
from app.utils import send_sync_channel_message
|
||||
|
||||
from .models import Torrent
|
||||
from .utils import transmission_handler
|
||||
|
||||
|
||||
@shared_task
|
||||
def update_transmission_data():
|
||||
@@ -19,8 +17,8 @@ def update_transmission_data():
|
||||
updated_torrents.append(torrent)
|
||||
if updated_torrents:
|
||||
Torrent.objects.bulk_update(updated_torrents, ["transmission_data"])
|
||||
send_sync_channel_message("torrent", "transmission_data_updated", {
|
||||
torrent.id: torrent.transmission_data
|
||||
for torrent in updated_torrents
|
||||
})
|
||||
|
||||
send_sync_channel_message(
|
||||
"torrent",
|
||||
"transmission_data_updated",
|
||||
{torrent.id: torrent.transmission_data for torrent in updated_torrents},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user