Skip to content

Commit

Permalink
Merge pull request #674 from nyaruka/move_interrupt_task
Browse files Browse the repository at this point in the history
Move `interrupt_channel` task into `tasks/interrupts`
  • Loading branch information
rowanseymour authored Oct 11, 2022
2 parents 349f0f8 + 5357da5 commit f66e0fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package channels
package interrupts

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package channels
package interrupts_test

import (
"testing"
"time"

"github.com/nyaruka/gocommon/dbutil/assertdb"
"github.com/nyaruka/mailroom/core/models"
"github.com/nyaruka/mailroom/core/tasks/interrupts"
"github.com/nyaruka/mailroom/core/tasks/msgs"
"github.com/nyaruka/mailroom/testsuite"
"github.com/nyaruka/mailroom/testsuite/testdata"
Expand Down Expand Up @@ -52,7 +53,7 @@ func TestInterruptChannel(t *testing.T) {
assertdb.Query(t, db, `SELECT count(*) FROM msgs_msg WHERE status = 'F' and channel_id = $1`, testdata.TwilioChannel.ID).Returns(0)

// twilio channel task
task := &InterruptChannelTask{
task := &interrupts.InterruptChannelTask{
ChannelID: testdata.TwilioChannel.ID,
}

Expand Down Expand Up @@ -83,7 +84,7 @@ func TestInterruptChannel(t *testing.T) {
})

// vonage channel task
task = &InterruptChannelTask{
task = &interrupts.InterruptChannelTask{
ChannelID: testdata.VonageChannel.ID,
}

Expand Down
1 change: 0 additions & 1 deletion core/tasks/interrupts/interrupt_sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/nyaruka/mailroom/core/models"
"github.com/nyaruka/mailroom/core/tasks"
"github.com/nyaruka/mailroom/runtime"

"github.com/pkg/errors"
)

Expand Down
6 changes: 3 additions & 3 deletions core/tasks/interrupts/interrupt_sessions_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package interrupts
package interrupts_test

import (
"testing"
Expand All @@ -7,9 +7,9 @@ import (
"github.com/nyaruka/gocommon/dbutil/assertdb"
_ "github.com/nyaruka/mailroom/core/handlers"
"github.com/nyaruka/mailroom/core/models"
"github.com/nyaruka/mailroom/core/tasks/interrupts"
"github.com/nyaruka/mailroom/testsuite"
"github.com/nyaruka/mailroom/testsuite/testdata"

"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -77,7 +77,7 @@ func TestInterrupts(t *testing.T) {
sessionIDs[4] = insertSession(testdata.Org1, testdata.Bob, testdata.Favorites, models.NilCallID)

// create our task
task := &InterruptSessionsTask{
task := &interrupts.InterruptSessionsTask{
SessionIDs: []models.SessionID{sessionIDs[4]},
ContactIDs: tc.contactIDs,
FlowIDs: tc.flowIDs,
Expand Down

0 comments on commit f66e0fa

Please sign in to comment.