Implement immediate deployment, and automatically load scheduled tasks when the service starts.

This commit is contained in:
yoan
2024-08-21 16:34:28 +08:00
parent 90967fc2e1
commit f6760515e9
16 changed files with 539 additions and 238 deletions

View File

@@ -7,7 +7,7 @@ export const list = async (req: DeploymentListReq) => {
page = req.page;
}
let perPage = 10;
let perPage = 50;
if (req.perPage) {
perPage = req.perPage;
}
@@ -19,7 +19,7 @@ export const list = async (req: DeploymentListReq) => {
.collection("deployments")
.getList<Deployment>(page, perPage, {
filter: filter,
sort: "-id",
sort: "-deployedAt",
expand: "domain",
});
};

View File

@@ -17,9 +17,9 @@ export const get = async (id: string) => {
export const save = async (data: Domain) => {
if (data.id) {
return await getPb().collection("domains").update(data.id, data);
return await getPb().collection("domains").update<Domain>(data.id, data);
}
return await getPb().collection("domains").create(data);
return await getPb().collection("domains").create<Domain>(data);
};
export const remove = async (id: string) => {