From de9648ca847cf032aab6da9cac1217bf9cca9c90 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 9 Sep 2020 06:26:11 +0000 Subject: www: manifest.js.gz generation no longer hogs event loop It's still as slow as before with hundreds/thousands of inboxes, but at least it's fair. Future changes will allow it to be cached and memoized with persistent HTTP servers. --- t/www_listing.t | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 't/www_listing.t') diff --git a/t/www_listing.t b/t/www_listing.t index c4511cd1..4309a5e1 100644 --- a/t/www_listing.t +++ b/t/www_listing.t @@ -10,9 +10,10 @@ use PublicInbox::Import; require_mods(qw(URI::Escape Plack::Builder Digest::SHA IO::Compress::Gzip IO::Uncompress::Gunzip HTTP::Tiny)); require PublicInbox::WwwListing; +require PublicInbox::ManifestJsGz; my $json = do { no warnings 'once'; - $PublicInbox::WwwListing::json; + $PublicInbox::ManifestJsGz::json; } or plan skip_all => "JSON module missing"; use_ok 'PublicInbox::Git'; @@ -20,7 +21,7 @@ use_ok 'PublicInbox::Git'; my ($tmpdir, $for_destroy) = tmpdir(); my $bare = PublicInbox::Git->new("$tmpdir/bare.git"); PublicInbox::Import::init_bare($bare->{git_dir}); -is(PublicInbox::WwwListing::fingerprint($bare), undef, +is(PublicInbox::ManifestJsGz::fingerprint($bare), undef, 'empty repo has no fingerprint'); { my $fi_data = './t/git.fast-import-data'; @@ -30,7 +31,7 @@ is(PublicInbox::WwwListing::fingerprint($bare), undef, 'fast-import'); } -like(PublicInbox::WwwListing::fingerprint($bare), qr/\A[a-f0-9]{40}\z/, +like(PublicInbox::ManifestJsGz::fingerprint($bare), qr/\A[a-f0-9]{40}\z/, 'got fingerprint with non-empty repo'); sub tiny_test { -- cgit v1.2.3-24-ge0c7