refactor: use job terminology for consistency
This commit is contained in:
parent
d618f08275
commit
8885fd37cc
10
api/s5/s5.go
10
api/s5/s5.go
|
@ -805,12 +805,12 @@ func (s *S5API) accountPin(jc jape.Context) {
|
||||||
|
|
||||||
jobName := fmt.Sprintf("pin-import-%s", cid64)
|
jobName := fmt.Sprintf("pin-import-%s", cid64)
|
||||||
|
|
||||||
if task := s.cron.GetJobByName(jobName); task == nil {
|
if job := s.cron.GetJobByName(jobName); job == nil {
|
||||||
task := s.cron.RetryableJob(
|
job := s.cron.RetryableJob(
|
||||||
cron.RetryableJobParams{
|
cron.RetryableJobParams{
|
||||||
Name: jobName,
|
Name: jobName,
|
||||||
Tags: nil,
|
Tags: nil,
|
||||||
Function: s.pinImportCronTask,
|
Function: s.pinImportCronJob,
|
||||||
Args: []interface{}{cid64, next.Location().BytesURL(), next.Location().OutboardBytesURL(), userID},
|
Args: []interface{}{cid64, next.Location().BytesURL(), next.Location().OutboardBytesURL(), userID},
|
||||||
Attempt: 0,
|
Attempt: 0,
|
||||||
Limit: 10,
|
Limit: 10,
|
||||||
|
@ -819,7 +819,7 @@ func (s *S5API) accountPin(jc jape.Context) {
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
_, err = s.cron.CreateJob(task)
|
_, err = s.cron.CreateJob(job)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.sendErrorResponse(jc, NewS5Error(ErrKeyInternalError, err))
|
s.sendErrorResponse(jc, NewS5Error(ErrKeyInternalError, err))
|
||||||
return
|
return
|
||||||
|
@ -1472,7 +1472,7 @@ func (s *S5API) newFile(protocol *s5.S5Protocol, hash []byte) *S5File {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *S5API) pinImportCronTask(cid string, url string, proofUrl string, userId uint) error {
|
func (s *S5API) pinImportCronJob(cid string, url string, proofUrl string, userId uint) error {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
// Parse CID early to avoid unnecessary operations if it fails.
|
// Parse CID early to avoid unnecessary operations if it fails.
|
||||||
|
|
Loading…
Reference in New Issue