This repository has been archived by the owner on Nov 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#351: sleep longer in feed coordintator
up to 60 seconds.
- Loading branch information
Showing
2 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 1,7 @@ | ||
/* | ||
* This file is part of nzbget. See <http://nzbget.net>. | ||
* | ||
* Copyright (C) 2013-2016 Andrey Prygunkov <[email protected]> | ||
* Copyright (C) 2013-2019 Andrey Prygunkov <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -67,6 67,13 @@ class FeedCoordinator : public Thread, public Observer, public Subject, public D | |
virtual void Update(Subject* caller, void* aspect) { m_owner->DownloadQueueUpdate(caller, aspect); } | ||
}; | ||
|
||
class WorkStateObserver: public Observer | ||
{ | ||
public: | ||
FeedCoordinator* m_owner; | ||
virtual void Update(Subject* caller, void* aspect) { m_owner->WorkStateUpdate(caller, aspect); } | ||
}; | ||
|
||
class FeedCacheItem | ||
{ | ||
public: | ||
|
@@ -106,11 113,12 @@ class FeedCoordinator : public Thread, public Observer, public Subject, public D | |
FeedHistory m_feedHistory; | ||
Mutex m_downloadsMutex; | ||
DownloadQueueObserver m_downloadQueueObserver; | ||
WorkStateObserver m_workStateObserver; | ||
bool m_force = false; | ||
bool m_save = false; | ||
FeedCache m_feedCache; | ||
Mutex m_waitMutex; | ||
ConditionVar m_waitCond; | ||
bool m_wokenUp = false; | ||
|
||
void StartFeedDownload(FeedInfo* feedInfo, bool force); | ||
void FeedCompleted(FeedDownloader* feedDownloader); | ||
|
@@ -124,6 132,7 @@ class FeedCoordinator : public Thread, public Observer, public Subject, public D | |
void CheckSaveFeeds(); | ||
std::unique_ptr<FeedFile> parseFeed(FeedInfo* feedInfo); | ||
void SchedulerNextUpdate(FeedInfo* feedInfo, bool success); | ||
void WorkStateUpdate(Subject* caller, void* aspect); | ||
}; | ||
|
||
extern FeedCoordinator* g_FeedCoordinator; | ||
|