logging, gitignore, pin rns
This commit is contained in:
parent
decefb89d5
commit
a70d0db0bd
3 changed files with 10 additions and 3 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -7,3 +7,7 @@ dist/
|
|||
*.db-shm
|
||||
*.db-wal
|
||||
.env
|
||||
*.log
|
||||
.DS_Store
|
||||
.pytest_cache/
|
||||
.coverage
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ description = "Decentralized link-sharing forum for TinyWeb"
|
|||
license = {text = "AGPL-3.0-only"}
|
||||
requires-python = ">=3.9"
|
||||
dependencies = [
|
||||
"rns",
|
||||
"rns>=0.8.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
import json
|
||||
import logging
|
||||
import random
|
||||
import threading
|
||||
import time
|
||||
import RNS
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from tinyweb_forum.bloom import BloomFilter
|
||||
|
||||
FORUM_APP = "tinyweb-forum"
|
||||
|
|
@ -105,7 +108,7 @@ class ForumSync:
|
|||
count += 1
|
||||
except Exception as e:
|
||||
self.fdb.record_sync_result(inst["instance_hash"], False)
|
||||
print(f"[forum] sync error with {inst['instance_hash'][:16]}: {e}")
|
||||
logger.error("sync error with %s: %s", inst["instance_hash"][:16], e)
|
||||
return count
|
||||
|
||||
def _start_sync_loop(self):
|
||||
|
|
@ -153,7 +156,7 @@ class ForumSync:
|
|||
self._sync_with(inst["instance_hash"], my_topics)
|
||||
except Exception as e:
|
||||
self.fdb.record_sync_result(inst["instance_hash"], False)
|
||||
print(f"[forum] sync error with {inst['instance_hash'][:16]}: {e}")
|
||||
logger.error("sync error with %s: %s", inst["instance_hash"][:16], e)
|
||||
except Exception:
|
||||
pass
|
||||
prune_counter += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue