Coverage for otaku_info/background/__init__.py: 100%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

8 statements  

1"""LICENSE 

2Copyright 2020 Hermann Krumrey <hermann@krumreyh.com> 

3 

4This file is part of otaku-info. 

5 

6otaku-info is free software: you can redistribute it and/or modify 

7it under the terms of the GNU General Public License as published by 

8the Free Software Foundation, either version 3 of the License, or 

9(at your option) any later version. 

10 

11otaku-info is distributed in the hope that it will be useful, 

12but WITHOUT ANY WARRANTY; without even the implied warranty of 

13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

14GNU General Public License for more details. 

15 

16You should have received a copy of the GNU General Public License 

17along with otaku-info. If not, see <http://www.gnu.org/licenses/>. 

18LICENSE""" 

19 

20from typing import Dict, Tuple, Callable 

21from otaku_info.background.anilist import update_anilist_data 

22from otaku_info.background.mangadex import update_mangadex_data 

23from otaku_info.background.anilist_manga_chapter_guesses import \ 

24 update_anilist_manga_chapter_guesses 

25from otaku_info.background.notifications import send_new_update_notifications 

26from otaku_info.background.ln_releases import update_ln_releases 

27 

28 

29bg_tasks: Dict[str, Tuple[int, Callable]] = { 

30 "anilist_update": (60 * 5, update_anilist_data), 

31 "anilist_chapter_guesses": (60 * 30, update_anilist_manga_chapter_guesses), 

32 "mangadex_update": (60 * 60 * 24, update_mangadex_data), 

33 "update_notifications": (60, send_new_update_notifications), 

34 "ln_release_updates": (60 * 60 * 24, update_ln_releases) 

35} 

36""" 

37A dictionary containing background tasks for the flask application 

38"""