feat: task reloading

This commit is contained in:
Simon Ding
2024-07-12 15:21:33 +08:00
parent 55966b8115
commit 799884f73c
4 changed files with 81 additions and 17 deletions

View File

@@ -328,6 +328,15 @@ func (c *Client) GetHistories() ent.Histories {
return h
}
func (c *Client) GetRunningHistories() ent.Histories {
h, err := c.ent.History.Query().Where(history.Completed(false)).All(context.TODO())
if err != nil {
return nil
}
return h
}
func (c *Client) GetHistory(id int) *ent.History {
return c.ent.History.Query().Where(history.ID(id)).FirstX(context.TODO())
}