[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive e2685023a7 18/31: Add: (h/clear-cache) Clear lo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive e2685023a7 18/31: Add: (h/clear-cache) Clear local cache for file or directory |
Date: |
Wed, 12 Jun 2024 19:00:41 -0400 (EDT) |
branch: elpa/hyperdrive
commit e2685023a7598962c94882c8ca1035de7d4c69c8
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Add: (h/clear-cache) Clear local cache for file or directory
---
hyperdrive.el | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hyperdrive.el b/hyperdrive.el
index 87aef7f4b7..71017e669a 100644
--- a/hyperdrive.el
+++ b/hyperdrive.el
@@ -181,6 +181,25 @@ Interactively, prompt for hyperdrive and action."
(propertize "safe" 'face 'success)
(propertize "unsafe" 'face 'error))))))
+(defun h/clear-cache (entry)
+ "Clear local cache for file or directory ENTRY.
+Only clears the cache for the file or directory at ENTRY's
+version; other versions of the file or directory are not cleared."
+ ;; TODO: Considering support an :all-versions key for clearing the cache for
+ ;; all versions of the file/directory.
+ (interactive (list (hyperdrive--context-entry)))
+ (let ((url (he/url entry)))
+ (h/api 'delete url
+ :headers '(("Cache-Control" . "no-store"))
+ :as 'response
+ :else (lambda (err)
+ (h/error "Unable to clear cache for `%s': %S" url err))
+ :then (lambda (response)
+ (h//fill entry (plz-response-headers response))
+ ;; TODO: When file sizes in hyperdrive-dir-mode are colorized
+ ;; based locally downloaded sizes, refresh ewoc entry here.
+ ))))
+
;;;###autoload
(defun hyperdrive-purge (hyperdrive)
"Purge all data corresponding to HYPERDRIVE."
- [nongnu] elpa/hyperdrive 316e5579fb 27/31: Change: (h/clear-cache) Prompt for confirmation and report success, (continued)
- [nongnu] elpa/hyperdrive 316e5579fb 27/31: Change: (h/clear-cache) Prompt for confirmation and report success, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 035b3bc5ac 29/31: Change: (h/forget-file) Rename from h/clear-cache, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive ad6c7b90ab 31/31: Add hyperdrive-forget-file command, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive a20c4b9410 21/31: Tidy: (hyperdrive-menu) Capitalization, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 0bb8d21108 26/31: Change: (h/dir-mode-map) Add binding for h/clear-cache, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 81c4b90895 10/31: Tidy: (h/fill) Set then to 'sync by default, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 1db1a4f54a 12/31: Comment: Update TODO, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 965b39f5d9 24/31: Change: (h/menu-bar-menu) Add binding for h/clear-cache, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 019c9f3c6a 13/31: Fix: (h//fill) Only fill version range when Etag is non-nil, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive dcbb6c2e15 16/31: Meta: Update hyper-gateway-ushin to 3.9.1: More X-Drive-Size headers, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive e2685023a7 18/31: Add: (h/clear-cache) Clear local cache for file or directory,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 499a591d4b 22/31: Change: (h/clear-cache) Use POST instead of DELETE to clear cache, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 0db40da6f9 28/31: Meta: Update hyper-gateway-ushin to 3.9.2: Clear old versions, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive d4d3d92e17 07/31: Refactor: (h/fill-metadata) Don't use :as, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive d8e96321d2 08/31: Fix: (h/fill-metadata) Fill disk-usage from GET request, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive e6cca3ccc9 19/31: Fix: (hyperdrive-new) :as 'response, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 5a4f6b9607 09/31: Fix: (h/download-url) Fill disk-usage from GET request, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive dd3670e43e 17/31: Comment: Add TODO, ELPA Syncer, 2024/06/12
- [nongnu] elpa/hyperdrive 2f1aebbe04 30/31: Docs: (hyperdrive-forget-file) Document command, ELPA Syncer, 2024/06/12