Nukesor / hetznerbot

:calling: Get the newest hetzner server offers right to your telegram chat.
GNU General Public License v3.0
18 stars 6 forks source link

rehaul how drives are handled #11

Closed hildebro closed 1 year ago

hildebro commented 1 year ago

previously, the fields hdd_count and hdd_size where used. these had various problems:

so now, we use the more accurate array serverDiskData to fetch all types of disks.

also changed the offer formatting to account for the new types.

todo for another PR: add /set commands for ssds

one small issue with the PR: the new model offer_disk has an id property, because sqlalchemy doesn't like tables without a primary key. now on each call to update_offers, we toss away all existing entries and write new ones. this causes the id values to keep getting bigger over time.

Nukesor commented 1 year ago

FYI, there's a just format action, which should fix all issues that come up in the CI

You can check via just lint

Nukesor commented 1 year ago

Nice. Thanks for the contribution :blush: