commit e0fba80405ff7ea29d1680098031eaee3e165628
parent 52d2b4c86d365689e6927fb5b8fdfc68985fe70a
Author: René Wagner <rwa@clttr.info>
Date: Fri, 21 May 2021 21:58:18 +0200
some exception handling and updated service files
Diffstat:
4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/gus/constants.py b/gus/constants.py
@@ -6,7 +6,7 @@ DB_FILENAME = "gus.sqlite"
FEED_FILE = "feeds.txt"
MAXIMUM_REDIRECT_CHAIN_LENGTH = 5
MAXIMUM_FAILED_REQUEST_COUNT = 5
-MAXIMUM_TEXT_PAGE_SIZE = 100000 # 100KB, in bytes
+MAXIMUM_TEXT_PAGE_SIZE = 1000000 # 1000KB, in bytes
# default change frequencies (in hours)
ROOT_CHANGE_FREQUENCY_DEFAULT = 12
diff --git a/gus/crawl.py b/gus/crawl.py
@@ -440,7 +440,11 @@ def should_skip(resource):
def index_links(from_resource, contained_resources):
from_page, created = Page.get_or_create(url=from_resource.indexable_url)
- Link.delete().where(Link.from_page == from_page).execute()
+
+ try:
+ Link.delete().where(Link.from_page == from_page).execute()
+ except:
+ logging.error("Error deleting link: %s", gus.lib.logging.strip_control_chars(Link.from_page))
data = []
for cr in contained_resources:
if should_skip(cr):
diff --git a/infra/gus.service b/infra/gus.service
@@ -9,14 +9,14 @@ Group=gus
Type=simple
Restart=always
RestartSec=5
-WorkingDirectory=/home/gus/code/gus
+WorkingDirectory=/home/gus/
Environment="PYTHONUNBUFFERED=1"
ExecStart=/home/gus/.poetry/bin/poetry run serve \
- --host "::" \
--port 1965 \
- --hostname gus.guru \
- --tls-certfile certs/cert.pem \
- --tls-keyfile certs/key.pem
+ --host "::" \
+ --hostname geminispace.info \
+ --tls-certfile geminispace.info.crt \
+ --tls-keyfile geminispace.info.key
[Install]
WantedBy=default.target
diff --git a/infra/update_index.sh b/infra/update_index.sh
@@ -4,4 +4,3 @@ rm -rf /home/gus/index.old
rm -rf /home/gus/index.new/MAIN.tmp/
mv /home/gus/index /home/gus/index.old
mv /home/gus/index.new /home/gus/index
-sudo systemctl restart gus