- Organisiert eine Vielzahl von Skripten aus dem Root-Verzeichnis in thematische Unterordner, um die Übersichtlichkeit zu verbessern und die Migration vorzubereiten. - Verschiebt SuperOffice-bezogene Test- und Hilfsskripte in . - Verschiebt Notion-bezogene Synchronisations- und Import-Skripte in . - Archiviert eindeutig veraltete und ungenutzte Skripte in . - Die zentralen Helfer und bleiben im Root, da sie von mehreren Tools als Abhängigkeit genutzt werden.
26 lines
728 B
Python
26 lines
728 B
Python
import sqlite3
|
|
import json
|
|
import time
|
|
|
|
DB_PATH = "connector_queue.db"
|
|
|
|
def trigger_resync(contact_id):
|
|
print(f"🚀 Triggering manual resync for Contact {contact_id}...")
|
|
|
|
payload = {
|
|
"Event": "contact.changed",
|
|
"PrimaryKey": contact_id,
|
|
"ContactId": contact_id,
|
|
"Changes": ["UserDefinedFields", "Name"] # Dummy changes to pass filters
|
|
}
|
|
|
|
with sqlite3.connect(DB_PATH) as conn:
|
|
conn.execute(
|
|
"INSERT INTO jobs (event_type, payload, status) VALUES (?, ?, ?)",
|
|
("contact.changed", json.dumps(payload), 'PENDING')
|
|
)
|
|
print("✅ Job added to queue.")
|
|
|
|
if __name__ == "__main__":
|
|
trigger_resync(6) # Bennis Playland has CRM ID 6
|