Skip to content

Commit 05261b6

Browse files
a few fixes that caome up in testing
1 parent c2405ef commit 05261b6

File tree

8 files changed

+49
-13
lines changed

8 files changed

+49
-13
lines changed

asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.02152627.css",
4-
"main.js": "/static/js/main.56147897.js",
4+
"main.js": "/static/js/main.4186a3e6.js",
55
"static/media/roboto-all-500-normal.woff": "/static/media/roboto-all-500-normal.0ab669b7a0d19b178f57.woff",
66
"static/media/roboto-all-700-normal.woff": "/static/media/roboto-all-700-normal.a457fde362a540fcadff.woff",
77
"static/media/roboto-all-400-normal.woff": "/static/media/roboto-all-400-normal.c5d001fa922fa66a147f.woff",
@@ -36,10 +36,10 @@
3636
"static/media/roboto-greek-ext-700-normal.woff2": "/static/media/roboto-greek-ext-700-normal.bd9854c751441ccc1a70.woff2",
3737
"index.html": "/index.html",
3838
"main.02152627.css.map": "/static/css/main.02152627.css.map",
39-
"main.56147897.js.map": "/static/js/main.56147897.js.map"
39+
"main.4186a3e6.js.map": "/static/js/main.4186a3e6.js.map"
4040
},
4141
"entrypoints": [
4242
"static/css/main.02152627.css",
43-
"static/js/main.56147897.js"
43+
"static/js/main.4186a3e6.js"
4444
]
4545
}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.56147897.js"></script><link href="/static/css/main.02152627.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.4186a3e6.js"></script><link href="/static/css/main.02152627.css" rel="stylesheet"></head><body><div id="root"></div></body></html>

pioreactorui/__init__.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,18 @@ def _get_app_db_connection():
168168
) # TODO: until next OS release which implements a native sqlite3 base64 function
169169

170170
db.row_factory = _make_dicts
171-
db.execute("PRAGMA foreign_keys = 1")
171+
db.executescript(
172+
"""
173+
PRAGMA journal_mode=WAL;
174+
PRAGMA synchronous = 1; -- aka NORMAL, recommended when using WAL
175+
PRAGMA temp_store = 2; -- stop writing small files to disk, use mem
176+
PRAGMA busy_timeout = 15000;
177+
PRAGMA foreign_keys = ON;
178+
PRAGMA synchronous = NORMAL;
179+
PRAGMA auto_vacuum = INCREMENTAL;
180+
PRAGMA cache_size = -20000;
181+
"""
182+
)
172183

173184
return db
174185

@@ -180,6 +191,19 @@ def _get_temp_local_metadata_db_connection():
180191
pioreactor_config.get("storage", "temporary_cache")
181192
)
182193
db.row_factory = _make_dicts
194+
db.executescript(
195+
"""
196+
PRAGMA journal_mode=WAL;
197+
PRAGMA synchronous = 1; -- aka NORMAL, recommended when using WAL
198+
PRAGMA temp_store = 2; -- stop writing small files to disk, use mem
199+
PRAGMA busy_timeout = 15000;
200+
PRAGMA foreign_keys = ON;
201+
PRAGMA synchronous = NORMAL;
202+
PRAGMA auto_vacuum = INCREMENTAL;
203+
PRAGMA cache_size = -20000;
204+
"""
205+
)
206+
183207
return db
184208

185209

pioreactorui/api.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,9 +1709,9 @@ def update_experiment_profile() -> ResponseReturnValue:
17091709
):
17101710
abort(404, "must end in .yaml")
17111711

1712-
except Exception:
1712+
except Exception as e:
17131713
# publish_to_error_log(msg, "create_experiment_profile")
1714-
return abort(400, "Invalid filename")
1714+
abort(400, str(e))
17151715

17161716
filepath = Path(env["DOT_PIOREACTOR"]) / "experiment_profiles" / experiment_profile_filename
17171717

@@ -1728,10 +1728,22 @@ def update_experiment_profile() -> ResponseReturnValue:
17281728
def get_experiment_profiles() -> ResponseReturnValue:
17291729
try:
17301730
profile_path = Path(env["DOT_PIOREACTOR"]) / "experiment_profiles"
1731-
files = sorted(profile_path.glob("*.y*ml"), key=os.path.getmtime, reverse=True)
1731+
files = sorted(profile_path.glob("*.y*ml"), key=lambda f: f.stat().st_mtime, reverse=True)
17321732

17331733
parsed_yaml = []
17341734
for file in files:
1735+
# allow empty files, it's annoying to users otherwise (and maybe theres a bug that wipes yamls?)
1736+
if file.stat().st_size == 0:
1737+
parsed_yaml.append(
1738+
{
1739+
"experimentProfile": {
1740+
"experiment_profile_name": f"temporary name: {file.stem}"
1741+
},
1742+
"file": str(file),
1743+
}
1744+
)
1745+
continue
1746+
17351747
try:
17361748
profile = yaml_decode(file.read_bytes(), type=Profile)
17371749
parsed_yaml.append({"experimentProfile": profile, "file": str(file)})
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/main.4186a3e6.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/main.56147897.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)