From: Joshua Watt <jpewhacker@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: Joshua Watt <JPEWhacker@gmail.com>
Subject: [bitbake-devel][PATCH 5/5] bitbake-hashclient: Add clean-unused subcommand
Date: Fri, 6 Oct 2023 09:36:45 -0600 [thread overview]
Message-ID: <20231006153645.1609760-6-JPEWhacker@gmail.com> (raw)
In-Reply-To: <20231006153645.1609760-1-JPEWhacker@gmail.com>
Adds a subcommand to clean unused outhash entries from the server based
on age
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
bitbake/bin/bitbake-hashclient | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/bitbake/bin/bitbake-hashclient b/bitbake/bin/bitbake-hashclient
index d09104336ab..3f265e8fa7b 100755
--- a/bitbake/bin/bitbake-hashclient
+++ b/bitbake/bin/bitbake-hashclient
@@ -121,6 +121,11 @@ def main():
else:
print("No query specified")
+ def handle_clean_unused(args, client):
+ result = client.clean_unused(args.max_age)
+ print("Removed %d rows" % (result["count"]))
+ return 0
+
parser = argparse.ArgumentParser(description='Hash Equivalence Client')
parser.add_argument('--address', default=DEFAULT_ADDRESS, help='Server address (default "%(default)s")')
parser.add_argument('--log', default='WARNING', help='Set logging level')
@@ -150,6 +155,10 @@ def main():
help="Remove entries from table where KEY == VALUE")
remove_parser.set_defaults(func=handle_remove)
+ clean_unused_parser = subparsers.add_parser('clean-unused', help="Remove unused database entries")
+ clean_unused_parser.add_argument("max_age", metavar="SECONDS", type=int, help="Remove unused entries older than SECONDS old")
+ clean_unused_parser.set_defaults(func=handle_clean_unused)
+
args = parser.parse_args()
logger = logging.getLogger('hashserv')
--
2.34.1
prev parent reply other threads:[~2023-10-06 15:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 15:36 [bitbake-devel][PATCH 0/5] Add cleanup commands for hash equivalence Joshua Watt
2023-10-06 15:36 ` [bitbake-devel][PATCH 1/5] hashserv: Add remove API Joshua Watt
2023-10-06 15:36 ` [bitbake-devel][PATCH 2/5] bitbake-hashclient: Add remove subcommand Joshua Watt
2023-10-06 15:36 ` [bitbake-devel][PATCH 3/5] hashserv: Extend get_outhash API to optionally include unihash Joshua Watt
2023-10-06 15:36 ` [bitbake-devel][PATCH 4/5] hashserv: Add API to clean unused entries Joshua Watt
2023-10-06 15:36 ` Joshua Watt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231006153645.1609760-6-JPEWhacker@gmail.com \
--to=jpewhacker@gmail.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.