provide a way to run app

This commit is contained in:
2024-08-10 14:14:38 +03:00
parent ba6ac26bac
commit 0046755c7d
10 changed files with 468 additions and 168 deletions

View File

@ -37,6 +37,13 @@ type repository struct {
client *mongo.Client
}
func (r *repository) Close() error {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()
return r.client.Disconnect(ctx)
}
func (r *repository) StatsRepository() statsRepository {
return statsRepository{
collection: r.client.Database("bench").Collection("device_stats"),