Skip to content

Commit 7f4f735

Browse files
committed
be a little more generous with saving compute server images before deprovisioning
1 parent 9ee6185 commit 7f4f735

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/packages/server/compute/maintenance/purchases/low-balance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import getMinBalance from "@cocalc/server/purchases/get-min-balance";
1212
import adminAlert from "@cocalc/server/messages/admin-alert";
1313

1414
// turn VM off if you don't have at least this much left.
15-
const COST_THRESH_DOLLARS = 2;
15+
const COST_THRESH_DOLLARS = 1;
1616

1717
// If can't buy -- even if you increase all quotas and balance by
1818
// this amount -- then delete. This is to avoid bad situations, e.g.,
@@ -27,7 +27,7 @@ const COST_THRESH_DOLLARS = 2;
2727
// NOTE: we do not automatically delete for a user with a negative balance
2828
// until it's way below (DELETE_THRESH_MARGIN_NEGATIVE_BALANCE) their negative,
2929
// as that indicates some trust.
30-
const DELETE_THRESH_MARGIN_DEFAULT = 0;
30+
const DELETE_THRESH_MARGIN_DEFAULT = 2;
3131
const DELETE_THRESH_MARGIN_NEGATIVE_BALANCE = 200;
3232

3333
const logger = getLogger("server:compute:maintenance:purchase:low-balance");

src/packages/server/compute/maintenance/purchases/manage-purchases.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ describe("confirm managing of purchases works", () => {
267267
// rule 6
268268
it("make time long so that balance is exceeded (but not by too much), and see that server gets stopped due to too low balance, and an email is sent to the user", async () => {
269269
resetTestMessages();
270-
await setPurchaseStart(new Date(Date.now() - 1000 * 60 * 60 * 24 * 10));
270+
await setPurchaseStart(new Date(Date.now() - 1000 * 60 * 60 * 24 * 7));
271271
const pool = getPool();
272272
await pool.query(
273273
"UPDATE compute_servers SET state='running', update_purchase=TRUE WHERE id=$1",

0 commit comments

Comments
 (0)