Skip to content

Commit

Permalink
removed achievement snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Cufee committed Jul 10, 2024
1 parent 7e43fbd commit 17971a4
Show file tree
Hide file tree
Showing 30 changed files with 141 additions and 4,241 deletions.
6 changes: 0 additions & 6 deletions internal/database/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/cufee/aftermath/internal/database/ent/db"
"github.com/cufee/aftermath/internal/database/ent/db/accountsnapshot"
"github.com/cufee/aftermath/internal/database/ent/db/achievementssnapshot"
"github.com/cufee/aftermath/internal/database/ent/db/crontask"
"github.com/cufee/aftermath/internal/database/ent/db/discordinteraction"
"github.com/cufee/aftermath/internal/database/ent/db/vehiclesnapshot"
Expand Down Expand Up @@ -39,10 +38,5 @@ func (c *client) DeleteExpiredSnapshots(ctx context.Context, expiration time.Tim
return err
}

_, err = c.db.AchievementsSnapshot.Delete().Where(achievementssnapshot.CreatedAtLT(expiration)).Exec(ctx)
if err != nil {
return err
}

return nil
}
3 changes: 0 additions & 3 deletions internal/database/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@ type UsersClient interface {

type SnapshotsClient interface {
GetAccountSnapshots(ctx context.Context, accountIDs []string, kind models.SnapshotType, options ...Query) ([]models.AccountSnapshot, error)
GetAchievementSnapshots(ctx context.Context, accountIDs []string, kind models.SnapshotType, options ...Query) ([]models.AchievementsSnapshot, error)
GetVehicleSnapshots(ctx context.Context, accountID string, vehicleIDs []string, kind models.SnapshotType, options ...Query) ([]models.VehicleSnapshot, error)

GetAccountLastBattleTimes(ctx context.Context, accountIDs []string, kind models.SnapshotType, options ...Query) (map[string]time.Time, error)
GetVehicleLastBattleTimes(ctx context.Context, accountID string, vehicleIDs []string, kind models.SnapshotType, options ...Query) (map[string]time.Time, error)
// last battle times for achievements would be equivalent to account/vehicle ones

CreateAccountSnapshots(ctx context.Context, snapshots ...models.AccountSnapshot) (map[string]error, error)
CreateAccountVehicleSnapshots(ctx context.Context, accountID string, snapshots ...models.VehicleSnapshot) (map[string]error, error)
CreateAccountAchievementSnapshots(ctx context.Context, accountID string, snapshots ...models.AchievementsSnapshot) (map[string]error, error)

DeleteExpiredSnapshots(ctx context.Context, expiration time.Time) error
}
Expand Down
22 changes: 3 additions & 19 deletions internal/database/ent/db/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 0 additions & 30 deletions internal/database/ent/db/account/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 0 additions & 23 deletions internal/database/ent/db/account/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 0 additions & 32 deletions internal/database/ent/db/account_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 17971a4

Please sign in to comment.