fix: recover stale shared asset locks
This commit is contained in:
@@ -83,8 +83,10 @@ func (a *App) acquireAsset(t *Task) (*MediaAsset, bool, error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if current.Status == "downloading" && current.OwnerTaskID != t.ID {
|
if current.Status == "downloading" && current.OwnerTaskID != t.ID {
|
||||||
|
if current.UpdatedAt.After(time.Now().Add(-10 * time.Minute)) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
}
|
||||||
current.Status, current.OwnerTaskID = "downloading", t.ID
|
current.Status, current.OwnerTaskID = "downloading", t.ID
|
||||||
if current.LocalPath == "" {
|
if current.LocalPath == "" {
|
||||||
current.LocalPath = filepath.Join(a.cfg.DownloadDir, safe(t.Artist)+" - "+safe(t.Title)+"."+t.Format)
|
current.LocalPath = filepath.Join(a.cfg.DownloadDir, safe(t.Artist)+" - "+safe(t.Title)+"."+t.Format)
|
||||||
|
|||||||
Reference in New Issue
Block a user