File tree Expand file tree Collapse file tree 3 files changed +6
-34
lines changed Expand file tree Collapse file tree 3 files changed +6
-34
lines changed Original file line number Diff line number Diff line change @@ -300,17 +300,12 @@ Future<shelf.Response> _handlePackagePage({
300
300
301
301
if (cachedPage == null ) {
302
302
final package = await packageBackend.lookupPackage (packageName);
303
- if (package == null || ! package.isVisible) {
304
- if (package? .isModerated ?? false ) {
305
- final content = renderModeratedPackagePage (packageName);
306
- return htmlResponse (content, status: 404 );
307
- }
308
- if (await packageBackend.isPackageModerated (packageName)) {
309
- final content = renderModeratedPackagePage (packageName);
310
- return htmlResponse (content, status: 404 );
311
- } else {
312
- return formattedNotFoundHandler (request);
313
- }
303
+ if (package == null ) {
304
+ return formattedNotFoundHandler (request);
305
+ }
306
+ if (package.isNotVisible) {
307
+ final content = renderModeratedPackagePage (packageName);
308
+ return htmlResponse (content, status: 404 );
314
309
}
315
310
final serviceSw = Stopwatch ()..start ();
316
311
final PackagePageData data;
Original file line number Diff line number Diff line change @@ -110,18 +110,6 @@ class PackageBackend {
110
110
}))! ;
111
111
}
112
112
113
- /// Whether the package has been deleted and a [ModeratedPackage] entity exists for it.
114
- Future <bool > isPackageModerated (String package) async {
115
- return (await cache.packageModerated (package).get (() async {
116
- final visible = await isPackageVisible (package);
117
- if (visible) {
118
- return false ;
119
- }
120
- final p = await lookupModeratedPackage (package);
121
- return p != null ;
122
- }))! ;
123
- }
124
-
125
113
Stream <Package > allPackages () => db.query <Package >().run ();
126
114
127
115
Stream <String > allPackageNames () {
@@ -1783,7 +1771,6 @@ api.PackagePublisherInfo _asPackagePublisherInfo(Package p) =>
1783
1771
Future <void > purgePackageCache (String package) async {
1784
1772
await Future .wait ([
1785
1773
cache.packageVisible (package).purge (),
1786
- cache.packageModerated (package).purge (),
1787
1774
cache.packageData (package).purge (),
1788
1775
cache.packageDataGz (package).purge (),
1789
1776
cache.packageLatestVersion (package).purge (),
Original file line number Diff line number Diff line change @@ -130,16 +130,6 @@ class CachePatterns {
130
130
decode: (d) => d as bool ,
131
131
))[package];
132
132
133
- Entry <bool > packageModerated (String package) => _cache
134
- .withPrefix ('package-moderated/' )
135
- .withTTL (Duration (days: 7 ))
136
- .withCodec (utf8)
137
- .withCodec (json)
138
- .withCodec (wrapAsCodec (
139
- encode: (bool value) => value,
140
- decode: (d) => d as bool ,
141
- ))[package];
142
-
143
133
Entry <List <int >> packageData (String package) => _cache
144
134
.withPrefix ('api-package-data-by-uri/' )
145
135
.withTTL (Duration (minutes: 10 ))['$package ' ];
You can’t perform that action at this time.
0 commit comments