Skip to content

Commit b7035e3

Browse files
authored
Merge pull request #567 from pietroalbini/overrides-bigint
limits: allow overriding memory limits to more than 4GB
2 parents fc011ef + 38a845f commit b7035e3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/db/migrate.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,17 @@ fn migrate_inner(version: Option<Version>, conn: &Connection, apply_mode: ApplyM
269269
// downgrade query
270270
"DROP TABLE blacklisted_crates;"
271271
),
272+
migration!(
273+
context,
274+
// version
275+
7,
276+
// description
277+
"Allow memory limits of more than 4 GB",
278+
// upgrade query
279+
"ALTER TABLE sandbox_overrides ALTER COLUMN max_memory_bytes TYPE BIGINT;",
280+
// downgrade query
281+
"ALTER TABLE sandbox_overrides ALTER COLUMN max_memory_bytes TYPE INTEGER;"
282+
),
272283
];
273284

274285
for migration in migrations {

src/docbuilder/limits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Limits {
3131
)?;
3232
if !res.is_empty() {
3333
let row = res.get(0);
34-
if let Some(memory) = row.get::<_, Option<i32>>("max_memory_bytes") {
34+
if let Some(memory) = row.get::<_, Option<i64>>("max_memory_bytes") {
3535
limits.memory = memory as usize;
3636
}
3737
if let Some(timeout) = row.get::<_, Option<i32>>("timeout_seconds") {

0 commit comments

Comments
 (0)