AI Update: یک مشکل بزرگ وجود دارد در این پروژه فقط یک نفر میتواند همزما

This commit is contained in:
Antigravity Bot
2026-08-30 08:57:01 +03:30
parent 9c9622ea70
commit 7ce6230bf2
3 changed files with 17 additions and 13 deletions
+3 -1
View File
@@ -347,8 +347,10 @@ class SessionManager:
"last_context_length": curr.last_context_length if curr else None,
"last_total_tokens": curr.last_total_tokens if curr else None,
}
with open(self.storage_file, "w", encoding="utf-8") as f:
tmp_file = f"{self.storage_file}.tmp.{os.getpid()}_{int(time.time()*1000)}"
with open(tmp_file, "w", encoding="utf-8") as f:
json.dump(data, f, indent=2)
os.replace(tmp_file, self.storage_file)
except Exception as e:
logger.error(f"Error saving sessions: {e}")
+2 -1
View File
@@ -5910,10 +5910,11 @@ def main():
logger.error("TELEGRAM_BOT_TOKEN is not set!")
sys.exit(1)
logger.info("Initializing Telegram Bot Application...")
logger.info("Initializing Telegram Bot Application with concurrent_updates enabled...")
application = (
Application.builder()
.token(settings.telegram_bot_token)
.concurrent_updates(True)
.post_init(on_startup)
.build()
)
File diff suppressed because one or more lines are too long