Skip to content

Conversation

@iurly
Copy link
Contributor

@iurly iurly commented Apr 30, 2025

No description provided.

@iurly iurly marked this pull request as ready for review May 6, 2025 10:35
Comment on lines +170 to +175
if cache.get(cache_key):
kernels = cache.get(cache_key)
else:
kernels = distro_obj.get_kernels(workspace, package, download_config, crawler_filter)
cache.put(cache_key, kernels)
cache.save()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure of the python version we have, but this could simplify:

Suggested change
if cache.get(cache_key):
kernels = cache.get(cache_key)
else:
kernels = distro_obj.get_kernels(workspace, package, download_config, crawler_filter)
cache.put(cache_key, kernels)
cache.save()
if (kernels := cache.get(cache_key)) is None:
kernels = distro_obj.get_kernels(workspace, package, download_config, crawler_filter)
cache.put(cache_key, kernels)
cache.save()

self.cache = yaml.load(yamldoc, Loader=yaml.FullLoader)

def make_key(kernel_type, machine, arch, distro_filter, kernel_filter):
return "{}-{}-{}-{}-{}".format(kernel_type, machine, arch, distro_filter, kernel_filter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT if we are running modern python; I think f-strings make these a lot easier to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants