mirror of
https://github.com/liberatedsystems/openCom-Companion.git
synced 2024-11-25 23:00:36 +01:00
Fix random announce interval calculation
This commit is contained in:
parent
454eedd8d1
commit
d6c5787104
@ -208,7 +208,7 @@ class SidebandCore():
|
|||||||
self.last_lxmf_announce = 0
|
self.last_lxmf_announce = 0
|
||||||
self.last_if_change_announce = 0
|
self.last_if_change_announce = 0
|
||||||
self.interface_local_adding = False
|
self.interface_local_adding = False
|
||||||
self.next_auto_announce = time.time() + 60*(random.random()*(SidebandCore.AUTO_ANNOUNCE_RANDOM_MAX-SidebandCore.AUTO_ANNOUNCE_RANDOM_MIN))
|
self.next_auto_announce = time.time() + 60*(random.random()*(SidebandCore.AUTO_ANNOUNCE_RANDOM_MAX-SidebandCore.AUTO_ANNOUNCE_RANDOM_MIN)+SidebandCore.AUTO_ANNOUNCE_RANDOM_MIN)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.path.isfile(self.config_path):
|
if not os.path.isfile(self.config_path):
|
||||||
@ -2657,7 +2657,7 @@ class SidebandCore():
|
|||||||
if self.is_standalone or self.is_service:
|
if self.is_standalone or self.is_service:
|
||||||
self.lxmf_destination.announce(attached_interface=attached_interface)
|
self.lxmf_destination.announce(attached_interface=attached_interface)
|
||||||
self.last_lxmf_announce = time.time()
|
self.last_lxmf_announce = time.time()
|
||||||
self.next_auto_announce = time.time() + 60*(random.random()*(SidebandCore.AUTO_ANNOUNCE_RANDOM_MAX-SidebandCore.AUTO_ANNOUNCE_RANDOM_MIN))
|
self.next_auto_announce = time.time() + 60*(random.random()*(SidebandCore.AUTO_ANNOUNCE_RANDOM_MAX-SidebandCore.AUTO_ANNOUNCE_RANDOM_MIN)+SidebandCore.AUTO_ANNOUNCE_RANDOM_MIN)
|
||||||
RNS.log("Next auto announce in "+RNS.prettytime(self.next_auto_announce-time.time()), RNS.LOG_DEBUG)
|
RNS.log("Next auto announce in "+RNS.prettytime(self.next_auto_announce-time.time()), RNS.LOG_DEBUG)
|
||||||
self.setstate("wants.announce", False)
|
self.setstate("wants.announce", False)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user