Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions app/lib/package/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1750,11 +1750,6 @@ class PackageBackend {
await tarballStorage.deleteArchiveFromAllBuckets(package, version);
}

/// Gets the file info of a [package] in the given [version].
Future<ObjectInfo?> packageTarballInfo(String package, String version) async {
return await tarballStorage.getPublicBucketArchiveInfo(package, version);
}

void _updatePackageAutomatedPublishingLock(
Package package, AuthenticatedAgent agent) {
final current = package.automatedPublishing;
Expand Down
11 changes: 6 additions & 5 deletions app/lib/shared/integrity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1059,8 +1059,8 @@ class TarballIntegrityChecker extends _BaseIntegrityChecker {
pv.package, pv.version!,
baseUri: activeConfiguration.primaryApiUri));

final shouldBeInPublicBucket =
await packageBackend.isPackageVisible(pv.package) && pv.isVisible;
final isPackageVisible = await packageBackend.isPackageVisible(pv.package);
final shouldBeInPublicBucket = isPackageVisible && pv.isVisible;

final canonicalInfo = await packageBackend.tarballStorage
.getCanonicalBucketArchiveInfo(pv.package, pv.version!);
Expand All @@ -1069,11 +1069,12 @@ class TarballIntegrityChecker extends _BaseIntegrityChecker {
return;
}

final info =
await packageBackend.packageTarballInfo(pv.package, pv.version!);
final info = await packageBackend.tarballStorage
.getPublicBucketArchiveInfo(pv.package, pv.version!);
if (info == null) {
if (shouldBeInPublicBucket) {
yield 'PackageVersion "${pv.qualifiedVersionKey}" has no matching public archive file.';
yield 'PackageVersion "${pv.qualifiedVersionKey}" has no matching public archive file '
'(Package: $isPackageVisible, PackageVersion: ${pv.isVisible}).';
}
return;
}
Expand Down
19 changes: 2 additions & 17 deletions app/lib/shared/redis_cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class CachePatterns {

Entry<bool> packageVisible(String package) => _cache
.withPrefix('package-visible/')
.withTTL(Duration(days: 7))
.withTTL(Duration(hours: 12))
.withCodec(utf8)
.withCodec(json)
.withCodec(wrapAsCodec(
Expand Down Expand Up @@ -312,7 +312,7 @@ class CachePatterns {

Entry<bool> publisherVisible(String publisherId) => _cache
.withPrefix('publisher-visible/')
.withTTL(Duration(days: 7))
.withTTL(Duration(hours: 12))
.withCodec(utf8)
.withCodec(json)
.withCodec(wrapAsCodec(
Expand All @@ -338,21 +338,6 @@ class CachePatterns {
.withPrefix('search-input-completion-data-json-gz/')
.withTTL(Duration(hours: 8))['-'];

/// Stores the flag that latest version of packages have been scanned for job entities.
Entry<bool> jobHistoryLatestScanned(String service) =>
jobHistoryPackageScanned(service, '');

/// Stores the flag that a [package]'s versions have been scanned for job entities.
Entry<bool> jobHistoryPackageScanned(String service, String package) => _cache
.withPrefix('job-history-package-scanned/')
.withTTL(Duration(days: 7))
.withCodec(utf8)
.withCodec(json)
.withCodec(wrapAsCodec(
encode: (bool value) => value,
decode: (d) => d as bool,
))['$service/$package'];

/// Cache for index objects, used by TaskBackend.
Entry<BlobIndex> taskResultIndex(String package, String version) => _cache
.withPrefix('task-result-index/')
Expand Down