Skip to content

Commit

Permalink
Merge pull request #511 from penguin-statistics/dev
Browse files Browse the repository at this point in the history
Release v3.14.6
  • Loading branch information
GalvinGao authored Nov 23, 2023
2 parents cba59d4 + 4e6be0d commit 62415d7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
type CommandDeps struct {
fx.In

DropReportArchiveService *service.Archive
ArchiveService *service.Archive
}

func Command(depsFn func() CommandDeps) *cli.Command {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func run(ctx *cli.Context, deps CommandDeps, dateStr string, deleteAfterArchive
return errors.Wrap(err, "failed to parse date")
}

if err = deps.DropReportArchiveService.ArchiveByDate(ctx.Context, date, deleteAfterArchive); err != nil {
if err = deps.ArchiveService.ArchiveByDate(ctx.Context, date, deleteAfterArchive); err != nil {
return errors.Wrap(err, "failed to run archiveDropReports")
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/antonmedv/expr v1.12.7
github.com/avast/retry-go/v4 v4.3.4
github.com/aws/aws-sdk-go-v2 v1.23.1
github.com/aws/aws-sdk-go-v2/config v1.25.4
github.com/aws/aws-sdk-go-v2/config v1.25.5
github.com/aws/aws-sdk-go-v2/credentials v1.16.4
github.com/aws/aws-sdk-go-v2/service/s3 v1.43.1
github.com/aws/smithy-go v1.17.0
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ github.com/aws/aws-sdk-go-v2 v1.23.1 h1:qXaFsOOMA+HsZtX8WoCa+gJnbyW7qyFFBlPqvTSz
github.com/aws/aws-sdk-go-v2 v1.23.1/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1 h1:ZY3108YtBNq96jNZTICHxN1gSBSbnvIdYwwqnvCV4Mc=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.1/go.mod h1:t8PYl/6LzdAqsU4/9tz28V/kU+asFePvpOMkdul0gEQ=
github.com/aws/aws-sdk-go-v2/config v1.25.4 h1:r+X1x8QI6FEPdJDWCNBDZHyAcyFwSjHN8q8uuus+Axs=
github.com/aws/aws-sdk-go-v2/config v1.25.4/go.mod h1:8GTjImECskr7D88P/Nn9uM4M4rLY9i77hLJZgkZEWV8=
github.com/aws/aws-sdk-go-v2/config v1.25.5 h1:UGKm9hpQS2hoK8CEJ1BzAW8NbUpvwDJJ4lyqXSzu8bk=
github.com/aws/aws-sdk-go-v2/config v1.25.5/go.mod h1:Bf4gDvy4ZcFIK0rqDu1wp9wrubNba2DojiPB2rt6nvI=
github.com/aws/aws-sdk-go-v2/credentials v1.16.4 h1:i7UQYYDSJrtc30RSwJwfBKwLFNnBTiICqAJ0pPdum8E=
github.com/aws/aws-sdk-go-v2/credentials v1.16.4/go.mod h1:Kdh/okh+//vQ/AjEt81CjvkTo64+/zIE4OewP7RpfXk=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.5 h1:KehRNiVzIfAcj6gw98zotVbb/K67taJE0fkfgM6vzqU=
Expand Down Expand Up @@ -757,8 +757,6 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/meta/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type AdminController struct {
TimeRangeService *service.TimeRange
ExportService *service.Export
AccountService *service.Account
DropReportArchiveService *service.Archive
ArchiveService *service.Archive
}

func RegisterAdmin(admin *svr.Admin, c AdminController) {
Expand Down Expand Up @@ -720,7 +720,7 @@ func (c *AdminController) ArchiveDropReports(ctx *fiber.Ctx) error {
return ctx.Status(fiber.StatusBadRequest).SendString("invalid date")
}

err = c.DropReportArchiveService.ArchiveByDate(ctx.UserContext(), date, request.DeleteAfterArchive)
err = c.ArchiveService.ArchiveByDate(ctx.UserContext(), date, request.DeleteAfterArchive)
if err != nil {
flog.ErrorFrom(ctx, "archive.drop_report").
Err(err).
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions internal/workers/calcwkr/calcwkr.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (

type WorkerDeps struct {
fx.In
DropMatrixService *service.DropMatrix
PatternMatrixService *service.PatternMatrix
TrendService *service.Trend
SiteStatsService *service.SiteStats
DropReportArchiveService *service.Archive
RedSync *redsync.Redsync
DropMatrixService *service.DropMatrix
PatternMatrixService *service.PatternMatrix
TrendService *service.Trend
SiteStatsService *service.SiteStats
ArchiveService *service.Archive
RedSync *redsync.Redsync
}

type Worker struct {
Expand Down Expand Up @@ -130,7 +130,7 @@ func (w *Worker) doMainCalc(sourceCategories []string) {
if server == "CN" {
// Archive
if err = w.microtask(ctx, "archive", server, func() error {
err := w.DropReportArchiveService.ArchiveByGlobalConfig(ctx)
err := w.ArchiveService.ArchiveByGlobalConfig(ctx)
return err
}); err != nil {
return err
Expand Down

0 comments on commit 62415d7

Please sign in to comment.