-
-
Notifications
You must be signed in to change notification settings - Fork 83
/
message.go
33 lines (27 loc) · 998 Bytes
/
message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package processor
import (
"github.com/bitmagnet-io/bitmagnet/internal/model"
"github.com/bitmagnet-io/bitmagnet/internal/protocol"
)
const MessageName = "process_torrent"
type ClassifyMode int
const (
// ClassifyModeDefault will use any pre-existing content match as a hint
// This is the most common use case and will only attempt to match previously unmatched torrents
ClassifyModeDefault ClassifyMode = iota
// ClassifyModeRematch will ignore any pre-existing classification and always classify from scratch
// This is useful if there are errors in matches from an earlier version that need to be corrected
ClassifyModeRematch
)
type MessageParams struct {
ClassifyMode ClassifyMode
ClassifierWorkflow string
InfoHashes []protocol.ID
}
func NewQueueJob(msg MessageParams, options ...model.QueueJobOption) (model.QueueJob, error) {
return model.NewQueueJob(
MessageName,
msg,
append([]model.QueueJobOption{model.QueueJobMaxRetries(2)}, options...)...,
)
}