fix
All checks were successful
Deploy Prod / Build (pull_request) Successful in 1m8s
Deploy Prod / Push (pull_request) Successful in 27s
Deploy Prod / Deploy prod (pull_request) Successful in 9s

This commit is contained in:
Egor Matveev
2025-07-17 23:12:43 +03:00
parent 357418c66c
commit a3182947a1
2 changed files with 34 additions and 0 deletions

View File

@@ -33,6 +33,14 @@ type InsertedTask struct {
Attempts int `bson:"attempts"`
}
func Count() (*int64, error) {
count, err := collection().CountDocuments(context.TODO(), bson.M{})
if err != nil {
return nil, err
}
return &count, nil
}
func Add(task InsertedTask) error {
_, err := collection().InsertOne(context.TODO(), task)
if err != nil {