refactor: use job terminology for consistency

This commit is contained in:
Derrick Hammer 2024-02-25 07:50:59 -05:00
parent d618f08275
commit 8885fd37cc
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 5 deletions

View File

@ -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.