-
Notifications
You must be signed in to change notification settings - Fork 0
/
redisRepositoryHelpers.go
58 lines (44 loc) · 1.33 KB
/
redisRepositoryHelpers.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package recipientsRepository
func getRecipientsRemainingKey(jobId string) string {
return jobId + ".recipients.remaining"
}
func getRecipientsSendingKey(jobId string) string {
return jobId + ".recipients.sending"
}
func getRecipientsFailedKey(jobId string) string {
return jobId + ".recipients.sendingFailed"
}
// must be in sync with LUA script in function PopRemaining
func getRecipientLeaseKey(jobId, recipient string) string {
return jobId + ".leases." + recipient
}
func getRecipientsLeaseKeyPrefix(jobId string) string {
return jobId + ".leases."
}
func getJobStatusKey(jobId string) string {
return getJobStateKey(jobId) + ".status"
}
func getJobTemplateKey(jobId string) string {
return getJobStateKey(jobId) + ".htmlTemplate"
}
func getJobStatusMessageKey(jobId string) string {
return getJobStateKey(jobId) + ".message"
}
func getJobNumberOfSentMailsKey(jobId string) string {
return getJobStateKey(jobId) + ".numberOfSentMails"
}
func getJobNumberOfSendingFailuresKey(jobId string) string {
return getJobStateKey(jobId) + ".numberOfSendingFailures"
}
func getJobNumberOfRecipientsKey(jobId string) string {
return getJobStateKey(jobId) + ".numberOfRecipients"
}
func getJobStateKey(jobId string) string {
return jobId + ".jobState"
}
func getOpenJobsKey() string {
return "openJobs"
}
func getJobsKey() string {
return "jobs"
}