Gnus development mailing list
 help / color / mirror / Atom feed
* Speeding up nnimap expiry when both source and target are groups on the same imap server
@ 2007-06-14 20:31 Bjørn Mork
  2007-06-18 17:14 ` Simon Josefsson
  0 siblings, 1 reply; 2+ messages in thread
From: Bjørn Mork @ 2007-06-14 20:31 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 106 bytes --]

I believe I've posted this before, but let's try again...  I've been
using this patch for quite a while:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnimap.diff --]
[-- Type: text/x-diff, Size: 1760 bytes --]

Index: lisp/nnimap.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v
retrieving revision 7.35
diff -u -r7.35 nnimap.el
--- lisp/nnimap.el	24 May 2007 15:16:12 -0000	7.35
+++ lisp/nnimap.el	14 Jun 2007 20:28:16 -0000
@@ -1465,14 +1465,23 @@
 
 (defun nnimap-expiry-target (arts group server)
   (unless (eq nnmail-expiry-target 'delete)
-    (with-temp-buffer
-      (dolist (art arts)
-	(nnimap-request-article art group server (current-buffer))
-	;; hints for optimization in `nnimap-request-accept-article'
-	(let ((nnimap-current-move-article art)
-	      (nnimap-current-move-group group)
-	      (nnimap-current-move-server server))
-	  (nnmail-expiry-target-group nnmail-expiry-target group))))
+    (if (and (not (functionp nnmail-expiry-target)) 
+	     (gnus-server-equal (gnus-group-method nnmail-expiry-target) 
+				(gnus-server-to-method 
+				 (format "nnimap:%s" server))))
+	;; moving article within same server, speed it up...
+	(and (nnimap-possibly-change-group group)
+	     (imap-message-copy (imap-range-to-message-set arts)
+				(gnus-group-short-name nnmail-expiry-target) 
+				'dontcreate nil nnimap-server-buffer))
+      (with-temp-buffer
+	(dolist (art arts)
+	  (nnimap-request-article art group server (current-buffer))
+	  ;; hints for optimization in `nnimap-request-accept-article'
+	  (let ((nnimap-current-move-article art)
+		(nnimap-current-move-group group)
+		(nnimap-current-move-server server))
+	    (nnmail-expiry-target-group nnmail-expiry-target group)))))
     ;; It is not clear if `nnmail-expiry-target' somehow cause the
     ;; current group to be changed or not, so we make sure here.
     (nnimap-possibly-change-group group server)))

[-- Attachment #3: Type: text/plain, Size: 220 bytes --]


Is it something that could be considered for Gnus, or am I the only one
ever to get frustrated by slow nnimap expiry?



Bjørn
-- 
It takes a Moonie ignoramus like you to say that every Iranian person
is a incompetent.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Speeding up nnimap expiry when both source and target are groups on the same imap server
  2007-06-14 20:31 Speeding up nnimap expiry when both source and target are groups on the same imap server Bjørn Mork
@ 2007-06-18 17:14 ` Simon Josefsson
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Josefsson @ 2007-06-18 17:14 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: ding

Bjørn Mork <bmork@dod.no> writes:

> I believe I've posted this before, but let's try again...  I've been
> using this patch for quite a while:

I don't use expiring...  could someone else that uses expiring with
nnimap test this please?  I'm not sure whether to install it without
someone else testing it first.

/Simon

>
> Index: lisp/nnimap.el
> ===================================================================
> RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v
> retrieving revision 7.35
> diff -u -r7.35 nnimap.el
> --- lisp/nnimap.el	24 May 2007 15:16:12 -0000	7.35
> +++ lisp/nnimap.el	14 Jun 2007 20:28:16 -0000
> @@ -1465,14 +1465,23 @@
>  
>  (defun nnimap-expiry-target (arts group server)
>    (unless (eq nnmail-expiry-target 'delete)
> -    (with-temp-buffer
> -      (dolist (art arts)
> -	(nnimap-request-article art group server (current-buffer))
> -	;; hints for optimization in `nnimap-request-accept-article'
> -	(let ((nnimap-current-move-article art)
> -	      (nnimap-current-move-group group)
> -	      (nnimap-current-move-server server))
> -	  (nnmail-expiry-target-group nnmail-expiry-target group))))
> +    (if (and (not (functionp nnmail-expiry-target)) 
> +	     (gnus-server-equal (gnus-group-method nnmail-expiry-target) 
> +				(gnus-server-to-method 
> +				 (format "nnimap:%s" server))))
> +	;; moving article within same server, speed it up...
> +	(and (nnimap-possibly-change-group group)
> +	     (imap-message-copy (imap-range-to-message-set arts)
> +				(gnus-group-short-name nnmail-expiry-target) 
> +				'dontcreate nil nnimap-server-buffer))
> +      (with-temp-buffer
> +	(dolist (art arts)
> +	  (nnimap-request-article art group server (current-buffer))
> +	  ;; hints for optimization in `nnimap-request-accept-article'
> +	  (let ((nnimap-current-move-article art)
> +		(nnimap-current-move-group group)
> +		(nnimap-current-move-server server))
> +	    (nnmail-expiry-target-group nnmail-expiry-target group)))))
>      ;; It is not clear if `nnmail-expiry-target' somehow cause the
>      ;; current group to be changed or not, so we make sure here.
>      (nnimap-possibly-change-group group server)))
>
>
> Is it something that could be considered for Gnus, or am I the only one
> ever to get frustrated by slow nnimap expiry?
>
>
>
> Bjørn
> -- 
> It takes a Moonie ignoramus like you to say that every Iranian person
> is a incompetent.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-18 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-14 20:31 Speeding up nnimap expiry when both source and target are groups on the same imap server Bjørn Mork
2007-06-18 17:14 ` Simon Josefsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).