Fixes problem with notices cache#14229
Conversation
| except Exception: | ||
| try: | ||
| # Remove the notices cache file if we encounter an exception | ||
| cache.clear_cache() |
There was a problem hiding this comment.
I'm still not sure this is the right approach to use. This means that every time an error is encountered, the cache files get removed and then conda checks again for these notices which is probably not the desired behavior 😭.
There was a problem hiding this comment.
ah good point, what kind of exceptions could we expect here?
There was a problem hiding this comment.
Any type of error because if any error occurs at all during the command that is decorated with this decorator, we don't want the notices to be shown. At that point, there's so much output on the screen that it would be too much information presented.
CodSpeed Instrumentation Performance ReportMerging #14229 will not alter performanceComparing Summary
|
conda/notices/cache.py
Outdated
|
|
||
| current_time = time.time() | ||
| create_time = current_time - NOTICES_DECORATOR_DISPLAY_INTERVAL | ||
| os.utime(cache_file, (create_time, create_time)) |
There was a problem hiding this comment.
This seems really odd. Can we write the timestamp to a file that has true filesystem timestamps (i.e. the current time?) Recommend using mtime only as the timestamp conda cares about.
Co-authored-by: Ken Odegard <[email protected]>
Co-authored-by: Daniel Holth <[email protected]>
…ile setting modification time to past for immediate notice display
…st_main_notices.py`
…ing fixture settings for channel notices
travishathaway
left a comment
There was a problem hiding this comment.
I'm feeling good about the changes that @jezdez has made since I started working on this. I think it's ready to be merged.
…ronment variable for channel notices directly
Description
Fixes: #14072
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?