mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 71cdf742e4 | |||
| 10c7c19c03 |
@@ -67,8 +67,9 @@ if not config.cloud_mode_enabled:
|
||||
loop.run_until_complete(initialize_file_sync(app_config))
|
||||
except Exception as e:
|
||||
logger.error(f"File sync error: {e}", err=True)
|
||||
finally:
|
||||
loop.close()
|
||||
# Note: Do NOT close the loop here! This is a daemon thread that should
|
||||
# run until process exit. Closing the loop shuts down the ThreadPoolExecutor
|
||||
# which breaks aiofiles operations in background sync tasks.
|
||||
|
||||
logger.info(f"Sync changes enabled: {app_config.sync_changes}")
|
||||
if app_config.sync_changes:
|
||||
|
||||
@@ -56,9 +56,7 @@ class DatabaseType(Enum):
|
||||
if config.database_backend == DatabaseBackend.POSTGRES:
|
||||
if not config.database_url:
|
||||
raise ValueError("DATABASE_URL must be set when using Postgres backend")
|
||||
logger.info(
|
||||
f"Using Postgres database: {config.database_url.split('@')[1] if '@' in config.database_url else config.database_url}"
|
||||
)
|
||||
logger.info(f"Using Postgres database: {config.database_url}")
|
||||
return config.database_url
|
||||
|
||||
# Default to SQLite
|
||||
@@ -332,6 +330,9 @@ async def run_migrations(
|
||||
if app_config.database_backend == DatabaseBackend.POSTGRES:
|
||||
# Convert asyncpg URL to psycopg2 URL for Alembic
|
||||
db_url = db_url.replace("postgresql+asyncpg://", "postgresql://")
|
||||
elif app_config.database_backend == DatabaseBackend.SQLITE:
|
||||
# Convert aiosqlite URL to pysqlite URL for Alembic
|
||||
db_url = db_url.replace("sqlite+aiosqlite://", "sqlite:///")
|
||||
|
||||
config.set_main_option("sqlalchemy.url", db_url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user