| 916 | } |
| 917 | |
| 918 | func (b *Persistent) removePendingUpload(remote string) error { |
| 919 | b.tempQueueMux.Lock() |
| 920 | defer b.tempQueueMux.Unlock() |
| 921 | |
| 922 | return b.db.Update(func(tx *bolt.Tx) error { |
| 923 | bucket, err := tx.CreateBucketIfNotExists([]byte(tempBucket)) |
| 924 | if err != nil { |
| 925 | return fmt.Errorf("couldn't bucket for %v", tempBucket) |
| 926 | } |
| 927 | return bucket.Delete([]byte(remote)) |
| 928 | }) |
| 929 | } |
| 930 | |
| 931 | // updatePendingUpload allows to update an existing item in the queue while checking if it's not started in the same |
| 932 | // transaction. If it is started, it will not allow the update |