-
-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal.db
database is written to WAY too often
#2290
Comments
I applied this change: diff --git a/datasette/utils/internal_db.py b/datasette/utils/internal_db.py
index dbfcceb4..6a8c1eb8 100644
--- a/datasette/utils/internal_db.py
+++ b/datasette/utils/internal_db.py
@@ -66,9 +66,11 @@ async def init_internal_db(db):
async def populate_schema_tables(internal_db, db):
+ print("populate_schema_tables")
database_name = db.name
def delete_everything(conn):
+ print(" delete_everything")
conn.execute(
"DELETE FROM catalog_tables WHERE database_name = ?", [database_name]
) And confirmed that the |
Which lead me to this piece of code: Lines 486 to 505 in 86335dc
I thought for a moment that the |
To help investigate I upgraded this plugin: It doesn't seem to be showing the |
Added this debug code: diff --git a/datasette/app.py b/datasette/app.py
index 8591af6a..ea61ba75 100644
--- a/datasette/app.py
+++ b/datasette/app.py
@@ -486,8 +486,12 @@ class Datasette:
for database_name, db in self.databases.items():
schema_version = (await db.execute("PRAGMA schema_version")).first()[0]
# Compare schema versions to see if we should skip it
+ print("schema_version = {}, current_schema_version = {}".format(
+ schema_version, current_schema_versions.get(database_name)
+ ))
if schema_version == current_schema_versions.get(database_name):
continue
+ print(" Did not skip, gonna INSERT OR REPLACE INTO")
placeholders = "(?, ?, ?, ?)"
values = [database_name, str(db.path), db.is_memory, schema_version]
if db.path is None: And it looks like that |
I'm not at all sure that I'll try one last thing: I'm going to run |
I ran The MD5 of that file only updated after I altered the table schemas, which is as it should be. So this isn't a Datasette bug after all. |
I'm seeing Litestream backing up that database (when loaded on disk using the
--internal
option) constantly even when it shouldn't have had any changes.The text was updated successfully, but these errors were encountered: