1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 03:36:48 +00:00

feat(operations): job, claim and worker lease models

This commit is contained in:
catborise 2026-10-13 17:05:38 +03:00
parent 5f8f7a8643
commit 99b9aa2a3c
9 changed files with 305 additions and 0 deletions

View file

@ -79,6 +79,7 @@ INSTALLED_APPS = [
"storages",
"virtsecrets",
"logs",
"operations",
"rest_framework",
"axes",
]
@ -151,6 +152,14 @@ else:
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": Path.joinpath(BASE_DIR, "db.sqlite3"),
# IMMEDIATE takes the write lock when a transaction starts, so a
# check-then-write cannot interleave with another process; timeout
# is how long a writer waits for that lock (seconds). WAL is set
# per connection by the operations app.
"OPTIONS": {"transaction_mode": "IMMEDIATE", "timeout": 20},
# A file, not shared-cache memory: test threads and worker processes
# open the same database, and shared-cache locks ignore the timeout.
"TEST": {"NAME": os.getenv("WEBVIRTCLOUD_TEST_DB") or Path.joinpath(BASE_DIR, "test_db.sqlite3")},
}
}