mirror of
https://github.com/simon-ding/polaris.git
synced 2026-04-21 19:27:30 +08:00
feat: task reloading
This commit is contained in:
9
db/db.go
9
db/db.go
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user