wesselt / bunq2ynab

Upload bunq transactions to ynab
Other
72 stars 18 forks source link

Running multiple callbacks for different accounts #9

Closed cmeijburg closed 5 years ago

cmeijburg commented 5 years ago

Hi Wessel,

Many thanks for putting in the effort for this script, it is working like a charm here! I have different Bunq accounts that I’m able to sync separately with their respective YNAB accounts by running the bunq2ynab.py script for each account separately.

I’m now trying to use the auto_sync.py script to run things automatically in the background. I’m able to run this script for 1 account successfully (changes are being pushed almost immediately; great!). However, as soon as I try to run a separate instance of auto_sync.py for my next account, I receive errors:

root@debian-s-1vcpu-1gb-ams3-01:~/bunq2ynab# python3 auto_sync.py 13364 595916 CCM 'Bunq Gezamenlijk' Getting BUNQ identifiers... Getting YNAB identifiers... Adding BUNQ callback to: https://178.xxx.xxx.xxx:44716/bunq2ynab-autosync Listening on port 44716

Traceback (most recent call last): File "auto_sync.py", line 83, in serversocket.bind(('0.0.0.0', args.port)) OSError: [Errno 98] Address already in use Removing old callback... root@debian-s-1vcpu-1gb-ams3-01:~/bunq2ynab#

I’m running the separate instances of auto_sync.py via different screen sessions. Is it possible to set it up this way or am I missing something?

Thanks!

wesselt commented 5 years ago

The script now searches for a new port after a "Address already in use" error: https://github.com/wesselt/bunq2ynab/commit/6df51dfbceab4121a97e2d2abbf294b969e221d4

This should allow you to run different instances of auto_sync.py. Enjoy!