@@ -486,8 +486,15 @@ def size(self) -> int:
486
486
return len (self .header .encode ('utf-8' )) + sum (t .size ()
487
487
for t in self .threads )
488
488
489
- def update (self , summary , sort_threads : bool = False ) -> None :
490
- """Recombine threads and save page."""
489
+ def update (self ,
490
+ summary , * ,
491
+ sort_threads : bool = False ,
492
+ asynchronous : bool = False ) -> None :
493
+ """Recombine threads and save page.
494
+
495
+ .. versionchanged:: 10.0
496
+ the *asynchronous* parameter was added.
497
+ """
491
498
if sort_threads :
492
499
pywikibot .info ('Sorting threads...' )
493
500
self .threads .sort (key = lambda t : t .timestamp )
@@ -498,7 +505,7 @@ def update(self, summary, sort_threads: bool = False) -> None:
498
505
summary += ' ' + i18n .twtranslate (self .site .code ,
499
506
'archivebot-archive-full' )
500
507
self .text = newtext
501
- self .save (summary )
508
+ self .save (summary , asynchronous = asynchronous )
502
509
503
510
504
511
class PageArchiver :
@@ -791,7 +798,12 @@ def analyze_page(self) -> set[tuple[str, str]]:
791
798
return set ()
792
799
793
800
def run (self ) -> None :
794
- """Process a single DiscussionPage object."""
801
+ """Process a single DiscussionPage object.
802
+
803
+ .. versionchanged:: 10.0
804
+ save the talk page in asynchronous mode if ``-async`` option
805
+ was given but archive pages are saved in synchronous mode.
806
+ """
795
807
if not self .page .botMayEdit ():
796
808
return
797
809
@@ -849,7 +861,7 @@ def run(self) -> None:
849
861
comment = i18n .twtranslate (self .site .code ,
850
862
'archivebot-page-summary' ,
851
863
self .comment_params )
852
- self .page .update (comment )
864
+ self .page .update (comment , asynchronous = self . asynchronous )
853
865
854
866
855
867
def process_page (page , * args : Any ) -> bool :
0 commit comments