mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-03-17 21:31:52 +01:00
option to disable sync for profile dvms
This commit is contained in:
parent
fe46b4b4c7
commit
bbc4b7a04f
@ -31,7 +31,8 @@ class DiscoveryBotFarms(DVMTaskInterface):
|
||||
async def init_dvm(self, name, dvm_config: DVMConfig, nip89config: NIP89Config, nip88config: NIP88Config = None,
|
||||
admin_config: AdminConfig = None, options=None):
|
||||
dvm_config.SCRIPT = os.path.abspath(__file__)
|
||||
await self.sync_db()
|
||||
if self.dvm_config.UPDATE_DATABASE:
|
||||
await self.sync_db()
|
||||
|
||||
async def is_input_supported(self, tags, client=None, dvm_config=None):
|
||||
for tag in tags:
|
||||
@ -129,7 +130,8 @@ class DiscoveryBotFarms(DVMTaskInterface):
|
||||
return 0
|
||||
else:
|
||||
if Timestamp.now().as_secs() >= self.last_schedule + dvm_config.SCHEDULE_UPDATES_SECONDS:
|
||||
await self.sync_db()
|
||||
if self.dvm_config.UPDATE_DATABASE:
|
||||
await self.sync_db()
|
||||
self.last_schedule = Timestamp.now().as_secs()
|
||||
return 1
|
||||
|
||||
|
@ -35,7 +35,8 @@ class SearchUser(DVMTaskInterface):
|
||||
dvm_config.SCRIPT = os.path.abspath(__file__)
|
||||
if self.options.get("relay"):
|
||||
self.relay = self.options['relay']
|
||||
await self.sync_db()
|
||||
if self.dvm_config.UPDATE_DATABASE:
|
||||
await self.sync_db()
|
||||
|
||||
async def is_input_supported(self, tags, client=None, dvm_config=None):
|
||||
for tag in tags:
|
||||
@ -133,7 +134,8 @@ class SearchUser(DVMTaskInterface):
|
||||
return 0
|
||||
else:
|
||||
if Timestamp.now().as_secs() >= self.last_schedule + dvm_config.SCHEDULE_UPDATES_SECONDS:
|
||||
await self.sync_db()
|
||||
if self.dvm_config.UPDATE_DATABASE:
|
||||
await self.sync_db()
|
||||
self.last_schedule = Timestamp.now().as_secs()
|
||||
return 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user