Compare commits

...

2 commits

Author SHA1 Message Date
cb451f02af 🐛 catch another Exception (e.g. ValueError("Invalid Homeserver")) and try to reconnect
All checks were successful
ci / docker (push) Successful in 6m57s
Python formatting PEP8 / Python-PEP8 (push) Successful in 15s
2024-11-19 22:41:29 +01:00
01b34783cf 📝 update README 2024-11-19 22:41:01 +01:00
2 changed files with 15 additions and 3 deletions

View file

@ -6,10 +6,22 @@ The bot calls the Api and sends the invitation link via e-mail to a given receip
## Usage ## Usage
Use container image or run this after cloning: Use container image or run this after cloning. In both cases you need to create a `.env` file containing the matrix and mail server credentials:
```
cp. .env.example .env
```
If you want to run it without the container you can run it like this:
``` ```
. bin/activate . bin/activate
python -m matrix_bot_invitation_mailer python -m matrix_bot_invitation_mailer
``` ```
And for use with docker run it like this:
```
docker compose up -d
```

View file

@ -117,9 +117,9 @@ The link will be valid for 7 days.""".format(os.getenv("REGISTRATION_URL") + res
while True: while True:
try: try:
bot.run() bot.run()
except ServerDisconnectedError: except (ServerDisconnectedError, ValueError):
time.sleep(5)
logging.info("connection lost, reconnecting in 5 seconds...") logging.info("connection lost, reconnecting in 5 seconds...")
time.sleep(5)
except KeyboardInterrupt: except KeyboardInterrupt:
logging.info("exiting...") logging.info("exiting...")
sys.exit(0) sys.exit(0)