[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache 98344e50fb 8/8: Improve state transition update
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache 98344e50fb 8/8: Improve state transition update |
Date: |
Fri, 21 Jan 2022 10:57:30 -0500 (EST) |
branch: externals/dtache
commit 98344e50fb9155a8d3ede42eecc6a7a53ae2c198
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Improve state transition update
---
dtache.el | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/dtache.el b/dtache.el
index 835a6dfd3b..6f584f55fd 100644
--- a/dtache.el
+++ b/dtache.el
@@ -979,16 +979,16 @@ Optionally make the path LOCAL to host."
(defun dtache--session-state-transition-update (session)
"Update SESSION due to state transition."
;; Update session
- (setf (dtache--session-size session)
- (file-attribute-size
- (file-attributes
- (dtache--session-file session 'log))))
- (setf (dtache--session-time session)
- (dtache--update-session-time session))
- (setf (dtache--session-state session) 'inactive)
- (let ((status (or (plist-get (dtache--session-action session) :status)
- #'dtache-session-exit-code-status)))
- (setf (dtache--session-status session) (funcall status session)))
+ (let ((session-size (file-attribute-size
+ (file-attributes
+ (dtache--session-file session 'log))))
+ (session-time (dtache--update-session-time session) )
+ (status-fun (or (plist-get (dtache--session-action session) :status)
+ #'dtache-session-exit-code-status)))
+ (setf (dtache--session-size session) session-size)
+ (setf (dtache--session-time session) session-time)
+ (setf (dtache--session-state session) 'inactive)
+ (setf (dtache--session-status session) (funcall status-fun session)))
;; Send notification
(funcall dtache-notification-function session)
@@ -1037,16 +1037,16 @@ If SESSION is nonattachable fallback to a command that
doesn't rely on tee."
If APPROXIMATE, use latest modification time of SESSION's
log to deduce the end time."
- (let ((time (dtache--session-time session)))
+ (let* ((start-time (plist-get (dtache--session-time session) :start))
+ (end-time))
(if approximate
- (plist-put time :end
- (time-to-seconds
- (file-attribute-modification-time
- (file-attributes
- (dtache--session-file session 'log)))))
- (plist-put time :end (time-to-seconds)))
- (plist-put time :duration (- (plist-get time :end) (plist-get time
:start)))
- time))
+ (setq end-time
+ (time-to-seconds
+ (file-attribute-modification-time
+ (file-attributes
+ (dtache--session-file session 'log)))))
+ (setq end-time (time-to-seconds)))
+ `(:start ,start-time :end ,end-time :duration ,(- end-time start-time))))
(defun dtache--create-id (command)
"Return a hash identifier for COMMAND."
- [elpa] externals/dtache updated (c57f57a49e -> 98344e50fb), ELPA Syncer, 2022/01/21
- [elpa] externals/dtache 2395b0e034 3/8: Update notifications to reference host, ELPA Syncer, 2022/01/21
- [elpa] externals/dtache 5edde14d06 1/8: Rename log-size property to size, ELPA Syncer, 2022/01/21
- [elpa] externals/dtache d744ff82b8 2/8: Only update size when a session becomes inactive, ELPA Syncer, 2022/01/21
- [elpa] externals/dtache 87f3610778 5/8: Rename commands, ELPA Syncer, 2022/01/21
- [elpa] externals/dtache e6aa944f8b 6/8: Improve docstrings, ELPA Syncer, 2022/01/21
- [elpa] externals/dtache 050ac04bc3 7/8: Update dtache-open-session, ELPA Syncer, 2022/01/21
- [elpa] externals/dtache 98344e50fb 8/8: Improve state transition update,
ELPA Syncer <=
- [elpa] externals/dtache 88a41c9ee3 4/8: Improve session handling, ELPA Syncer, 2022/01/21