fix: Duplikate in Jobs-Tabelle verhindern, KTI als einziges Ziel
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
aad4e9b3c9
commit
52b71d16f4
1 changed files with 10 additions and 8 deletions
|
|
@ -123,14 +123,16 @@ HINWEIS: [Falls Preis unter 600 EUR verdächtig günstig, darauf hinweisen]'
|
||||||
('flugscanner-mu', '100.75.182.15', 'Muldenstein DE')
|
('flugscanner-mu', '100.75.182.15', 'Muldenstein DE')
|
||||||
""")
|
""")
|
||||||
|
|
||||||
# Standard-Jobs: Frankfurt → Phnom Penh (KTI), Premium Economy, Roundtrip
|
# Standard-Jobs nur einfügen wenn noch gar keine Jobs vorhanden
|
||||||
# HAN ist Umstieg — wird automatisch als günstigste Verbindung gefunden
|
# Verhindert Duplikate bei Container-Neustarts
|
||||||
c.execute("""
|
job_count = c.execute("SELECT COUNT(*) FROM jobs").fetchone()[0]
|
||||||
INSERT OR IGNORE INTO jobs (scanner, von, nach, tage, aufenthalt_tage, trip_type, kabine, intervall) VALUES
|
if job_count == 0:
|
||||||
('google_flights', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily'),
|
c.execute("""
|
||||||
('kayak', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily'),
|
INSERT INTO jobs (scanner, von, nach, tage, aufenthalt_tage, trip_type, kabine, intervall) VALUES
|
||||||
('trip', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily')
|
('google_flights', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily'),
|
||||||
""")
|
('kayak', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily'),
|
||||||
|
('trip', 'FRA', 'KTI', 30, 14, 'roundtrip', 'premium_economy', 'daily')
|
||||||
|
""")
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue