rename actions package

This commit is contained in:
tobi 2025-01-07 17:44:38 +01:00
commit 175107f6a3
55 changed files with 116 additions and 116 deletions

View file

@ -53,7 +53,7 @@ func (suite *AccountTestSuite) TestAccountActionSuspend() {
// Wait for action to finish.
if !testrig.WaitFor(func() bool {
return suite.state.Actions.TotalRunning() == 0
return suite.state.AdminActions.TotalRunning() == 0
}) {
suite.FailNow("timed out waiting for admin action(s) to finish")
}

View file

@ -68,7 +68,7 @@ func (p *Processor) accountActionSuspend(
) (string, gtserror.WithCode) {
actionID := id.NewULID()
errWithCode := p.state.Actions.Run(
errWithCode := p.state.AdminActions.Run(
ctx,
&gtsmodel.AdminAction{
ID: actionID,

View file

@ -19,7 +19,7 @@ package admin_test
import (
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/actions"
adminactions "github.com/superseriousbusiness/gotosocial/internal/admin"
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/email"
@ -91,7 +91,7 @@ func (suite *AdminStandardTestSuite) SetupTest() {
suite.db = testrig.NewTestDB(&suite.state)
suite.state.DB = suite.db
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
suite.state.AdminActions = adminactions.New(suite.state.DB, &suite.state.Workers)
suite.tc = typeutils.NewConverter(&suite.state)
testrig.StartTimelines(

View file

@ -76,10 +76,10 @@ func (p *Processor) createDomainAllow(
AccountID: adminAcct.ID,
}
if errWithCode := p.state.Actions.Run(
if errWithCode := p.state.AdminActions.Run(
ctx,
action,
p.state.Actions.DomainAllowF(action.ID, domainAllow),
p.state.AdminActions.DomainAllowF(action.ID, domainAllow),
); errWithCode != nil {
return nil, action.ID, errWithCode
}
@ -132,10 +132,10 @@ func (p *Processor) deleteDomainAllow(
AccountID: adminAcct.ID,
}
if errWithCode := p.state.Actions.Run(
if errWithCode := p.state.AdminActions.Run(
ctx,
action,
p.state.Actions.DomainUnallowF(action.ID, domainAllow),
p.state.AdminActions.DomainUnallowF(action.ID, domainAllow),
); errWithCode != nil {
return nil, action.ID, errWithCode
}

View file

@ -77,10 +77,10 @@ func (p *Processor) createDomainBlock(
Text: domainBlock.PrivateComment,
}
if errWithCode := p.state.Actions.Run(
if errWithCode := p.state.AdminActions.Run(
ctx,
action,
p.state.Actions.DomainBlockF(action.ID, domainBlock),
p.state.AdminActions.DomainBlockF(action.ID, domainBlock),
); errWithCode != nil {
return nil, action.ID, errWithCode
}
@ -133,10 +133,10 @@ func (p *Processor) deleteDomainBlock(
AccountID: adminAcct.ID,
}
if errWithCode := p.state.Actions.Run(
if errWithCode := p.state.AdminActions.Run(
ctx,
action,
p.state.Actions.DomainUnblockF(action.ID, domainBlock),
p.state.AdminActions.DomainUnblockF(action.ID, domainBlock),
); errWithCode != nil {
return nil, action.ID, errWithCode
}

View file

@ -48,10 +48,10 @@ func (p *Processor) DomainKeysExpire(
AccountID: adminAcct.ID,
}
if errWithCode := p.state.Actions.Run(
if errWithCode := p.state.AdminActions.Run(
ctx,
action,
p.state.Actions.DomainKeysExpireF(domain),
p.state.AdminActions.DomainKeysExpireF(domain),
); errWithCode != nil {
return action.ID, errWithCode
}

View file

@ -186,7 +186,7 @@ func (suite *DomainBlockTestSuite) awaitAction(actionID string) {
ctx := context.Background()
if !testrig.WaitFor(func() bool {
return suite.state.Actions.TotalRunning() == 0
return suite.state.AdminActions.TotalRunning() == 0
}) {
suite.FailNow("timed out waiting for admin action(s) to finish")
}