mirror of
https://github.com/aserper/masto-rss.git
synced 2025-12-17 13:25:25 +00:00
Fix container logging visibility
Changes: - Add -u flag to Python in Dockerfile to disable output buffering - Add startup messages in main.py showing bot configuration - Logs now appear immediately in kubectl logs output This fixes the issue where no logs were visible when running in Kubernetes pods due to Python's default stdout buffering.
This commit is contained in:
12
main.py
12
main.py
@@ -6,6 +6,8 @@ from bot import MastodonRSSBot
|
||||
|
||||
def main():
|
||||
"""Initialize and run the bot with environment configuration"""
|
||||
print("Starting Mastodon RSS Bot...")
|
||||
|
||||
# Load configuration from environment variables
|
||||
bot = MastodonRSSBot(
|
||||
client_id=os.environ["MASTODON_CLIENT_ID"],
|
||||
@@ -20,6 +22,16 @@ def main():
|
||||
),
|
||||
)
|
||||
|
||||
print(f"Bot configured successfully:")
|
||||
print(f" Instance: {os.environ['MASTODON_INSTANCE_URL']}")
|
||||
print(f" Feed URL: {os.environ['RSS_FEED_URL']}")
|
||||
print(f" Visibility: {os.environ.get('TOOT_VISIBILITY', 'public')}")
|
||||
print(f" Check interval: {os.environ.get('CHECK_INTERVAL', '300')} seconds")
|
||||
print(
|
||||
f" State file: {os.environ.get('PROCESSED_ENTRIES_FILE', '/state/processed_entries.txt')}"
|
||||
)
|
||||
print()
|
||||
|
||||
# Start the bot
|
||||
bot.run()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user