MCPcopy
hub / github.com/rclone/rclone / SearchPendingUpload

Method SearchPendingUpload

backend/cache/storage_persistent.go:841–860  ·  view source on GitHub ↗

SearchPendingUpload returns the file info from the pending queue of uploads

(remote string)

Source from the content-addressed store, hash-verified

839
840// SearchPendingUpload returns the file info from the pending queue of uploads
841func (b *Persistent) SearchPendingUpload(remote string) (started bool, err error) {
842 err = b.db.View(func(tx *bolt.Tx) error {
843 bucket := tx.Bucket([]byte(tempBucket))
844 if bucket == nil {
845 return fmt.Errorf("couldn't bucket for %v", tempBucket)
846 }
847
848 var tempObj = &tempUploadInfo{}
849 v := bucket.Get([]byte(remote))
850 err = json.Unmarshal(v, tempObj)
851 if err != nil {
852 return fmt.Errorf("pending upload (%v) not found %v", remote, err)
853 }
854
855 started = tempObj.Started
856 return nil
857 })
858
859 return started, err
860}
861
862// searchPendingUploadFromDir files currently pending upload from a single dir
863func (b *Persistent) searchPendingUploadFromDir(dir string) (remotes []string, err error) {

Callers 5

NewObjectFunction · 0.80
ObjectFromOriginalFunction · 0.80
isTempFileMethod · 0.80
tempFileStartedUploadMethod · 0.80

Calls 2

GetMethod · 0.65
ErrorfMethod · 0.45

Tested by 1