Skip to content
Snippets Groups Projects

Fix cmds requesting too quickly in a loop uids from pubkey with BMA (#438)

Merged Moul requested to merge 438_sleep into main
4 files
+ 10
1
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -13,6 +13,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
import time
from collections import OrderedDict
from operator import itemgetter
from typing import List
@@ -24,7 +25,7 @@ from pendulum import from_timestamp
from silkaj import tui
from silkaj.blockchain.tools import get_head_block
from silkaj.constants import ALL
from silkaj.constants import ALL, BMA_SLEEP
from silkaj.network import client_instance
from silkaj.wot.tools import identity_of
@@ -61,6 +62,7 @@ def list_blocks(number: int, detailed: bool) -> None:
issuers.append(issuer)
for pubkey in issuers_dict.keys():
issuer = issuers_dict[pubkey]
time.sleep(BMA_SLEEP)
try:
idty = identity_of(issuer["pubkey"])
except HTTPError:
Loading