add hosting to first run #7598

Merged
jessopb merged 8 commits from feat-autoHosting-and-firstRun into master 2022-06-02 21:24:11 +02:00
Showing only changes of commit ddd08454d6 - Show all commits

View file

@ -25,6 +25,9 @@ type Props = {
saveBlobs: boolean, saveBlobs: boolean,
}; };
const TWENTY_PERCENT = 0.2;
const TEN_PRECNT = 0.1;
function HostingSplash(props: Props) { function HostingSplash(props: Props) {
const { const {
handleNextPage, handleNextPage,
@ -53,10 +56,10 @@ function HostingSplash(props: Props) {
function getManagedLimitMB() { function getManagedLimitMB() {
const value = const value =
freeMB > totalMB * 0.2 // lots of free space? freeMB > totalMB * TWENTY_PERCENT // lots of free space?
? blobSpaceUsed > totalMB * 0.1 // using more than 10%? ? blobSpaceUsed > totalMB * TEN_PRECNT // using more than 10%?
? (freeMB + blobSpaceUsed) / 2 // e.g. 40g used plus 30g free, knock back to 35g limit, freeing to 35g ? (freeMB + blobSpaceUsed) / 2 // e.g. 40g used plus 30g free, knock back to 35g limit, freeing to 35g
: totalMB * 0.1 // let it go up to 10% : totalMB * TEN_PRECNT // let it go up to 10%
: (freeMB + blobSpaceUsed) / 2; // e.g. 40g used plus 10g free, knock back to 25g limit, freeing to 25g : (freeMB + blobSpaceUsed) / 2; // e.g. 40g used plus 10g free, knock back to 25g limit, freeing to 25g
return value > 10240 ? Math.floor(value / 1024) * 1024 : 0; return value > 10240 ? Math.floor(value / 1024) * 1024 : 0;
} }