import threading
import time
import sys

sys.stdout = open("/home/skylink/python/log.txt", "a")
print("🌟 Main script started", flush=True)

def worker():
    print("🧵 Background thread started", flush=True)
    while True:
        print("📸 Thread alive and running", flush=True)
        time.sleep(5)

thread = threading.Thread(target=worker, daemon=True)
thread.start()
# Keep the main thread alive
while True:
    time.sleep(10)
