SearchPendingUpload returns the file info from the pending queue of uploads
(remote string)
| 839 | |
| 840 | // SearchPendingUpload returns the file info from the pending queue of uploads |
| 841 | func (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 |
| 863 | func (b *Persistent) searchPendingUploadFromDir(dir string) (remotes []string, err error) { |