Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sladuca committed Feb 8, 2025
1 parent 952895e commit dac0076
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
27 changes: 12 additions & 15 deletions src/lib/buy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,15 @@ function QuoteAndBuy(props: { options: SfBuyOptions }) {
const quote = await getQuoteFromParsedSfBuyOptions(props.options);
if (!quote) {
return logAndQuit(
"No quote found for the desired order. Try with a different start date, duration, or price."
"No quote found for the desired order. Try with a different start date, duration, or price.",
);
}

pricePerGpuHour = getPricePerGpuHourFromQuote(quote);

startAt =
quote.start_at === "NOW"
? ("NOW" as const)
: parseStartAsDate(quote.start_at);
startAt = quote.start_at === "NOW"
? ("NOW" as const)
: parseStartAsDate(quote.start_at);

endsAt = dayjs(quote.end_at).toDate();

Expand Down Expand Up @@ -612,11 +611,11 @@ async function getQuoteFromParsedSfBuyOptions(options: SfBuyOptions) {

const minDurationSeconds = Math.max(
1,
durationSeconds - Math.ceil(durationSeconds * 0.1)
durationSeconds - Math.ceil(durationSeconds * 0.1),
);
const maxDurationSeconds = Math.max(
durationSeconds + 3600,
durationSeconds + Math.ceil(durationSeconds * 0.1)
durationSeconds + Math.ceil(durationSeconds * 0.1),
);

return await getQuote({
Expand Down Expand Up @@ -646,14 +645,12 @@ export async function getQuote(options: QuoteOptions) {
side: "buy",
instance_type: options.instanceType,
quantity: options.quantity,
min_start_date:
options.minStartTime === "NOW"
? ("NOW" as const)
: options.minStartTime.toISOString(),
max_start_date:
options.maxStartTime === "NOW"
? ("NOW" as const)
: options.maxStartTime.toISOString(),
min_start_date: options.minStartTime === "NOW"
? ("NOW" as const)
: options.minStartTime.toISOString(),
max_start_date: options.maxStartTime === "NOW"
? ("NOW" as const)
: options.maxStartTime.toISOString(),
min_duration: options.minDurationSeconds,
max_duration: options.maxDurationSeconds,
},
Expand Down
6 changes: 3 additions & 3 deletions src/lib/clusters/clusters.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Command } from "commander";
import { Box, Text, render, useApp } from "ink";
import { Box, render, Text, useApp } from "ink";
import Spinner from "ink-spinner";
import React, { useEffect, useState } from "react";
import yaml from "yaml";
Expand All @@ -8,8 +8,8 @@ import { logAndQuit } from "../../helpers/errors.ts";
import { Row } from "../Row.tsx";
import { decryptSecret, getKeys, regenerateKeys } from "./keys.tsx";
import {
KUBECONFIG_PATH,
createKubeconfig,
KUBECONFIG_PATH,
syncKubeconfig,
} from "./kubeconfig.ts";

Expand Down Expand Up @@ -376,7 +376,7 @@ async function removeClusterUserAction({
id,
},
},
}
},
);

if (!response.ok) {
Expand Down
5 changes: 4 additions & 1 deletion src/lib/orders/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export function registerOrders(program: Command) {
.description("List orders")
.option("--side <side>", "Filter by order side (buy or sell)")
.option("-t, --type <type>", "Filter by instance type")
.option("--public", "Include public orders. Only includes open orders. Adding `--only-open` will do nothing.")
.option(
"--public",
"Include public orders. Only includes open orders. Adding `--only-open` will do nothing.",
)
.option("--min-price <price>", "Filter by minimum price (in cents)")
.option("--max-price <price>", "Filter by maximum price (in cents)")
.option(
Expand Down

0 comments on commit dac0076

Please sign in to comment.