mirror of
https://github.com/house-of-vanity/OutFleet.git
synced 2025-10-23 16:59:08 +00:00
Fixed TG messages quotes. Fixed sync tasks loop.
This commit is contained in:
@@ -276,9 +276,14 @@ def certificate_updated(sender, instance, created, **kwargs):
|
||||
|
||||
# Schedule sync for each affected server
|
||||
for server in servers_to_sync:
|
||||
transaction.on_commit(
|
||||
lambda srv=server: srv.sync_inbounds()
|
||||
)
|
||||
# Only sync if server has sync_inbounds method (Xray servers)
|
||||
real_server = server.get_real_instance()
|
||||
if hasattr(real_server, 'sync_inbounds'):
|
||||
transaction.on_commit(
|
||||
lambda srv=real_server: srv.sync_inbounds()
|
||||
)
|
||||
else:
|
||||
logger.debug(f"Server {server.name} does not support inbound sync")
|
||||
|
||||
|
||||
@receiver(post_save, sender=SubscriptionGroup)
|
||||
|
@@ -297,7 +297,8 @@ def sync_users(self, server_id):
|
||||
logger.info(f"Directly synced {added_count} users for Xray server {server.name}")
|
||||
else:
|
||||
# For non-Xray servers, sync users directly (non-Xray servers should not create tasks)
|
||||
sync_result = server.sync_all_users()
|
||||
real_server = server.get_real_instance()
|
||||
sync_result = real_server.sync_users()
|
||||
|
||||
# Check if sync was successful (can be boolean or dict/string)
|
||||
sync_successful = bool(sync_result) and (
|
||||
|
Reference in New Issue
Block a user