Skip to content

Display 'use cache' when return result using cache#39

Open
shiimaxx wants to merge 4 commits intoheartbeatsjp:masterfrom
shiimaxx:display-cache-use
Open

Display 'use cache' when return result using cache#39
shiimaxx wants to merge 4 commits intoheartbeatsjp:masterfrom
shiimaxx:display-cache-use

Conversation

@shiimaxx
Copy link

Currently, whether the plugin uses cache for return results is not contains in messages. (but, I can display it use -O option)

I included 'use cache' in a message when the plugin uses the cache, to avoid confusion.

@netmarkjp
Copy link
Contributor

@shiimaxx Thanks ;)
If we aim to avoid confusion, I think it's better that we should print the datetime the cache was made too.
How do you think?

@shiimaxx shiimaxx force-pushed the display-cache-use branch 2 times, most recently from 67d2f2e to ec1aa5e Compare February 3, 2020 04:59
@shiimaxx
Copy link
Author

shiimaxx commented Feb 3, 2020

@netmarkjp
I changed the message to contains the datetime of cache because I think it's better.

$ python check_log_ng.py -p 'ERROR' -S ./seek -l 'test.log' --cachetime=10
OK - No matches found. (use cache created at 2020-02-03T14:48:09.866695)

Current implementation uses the naive object that doesn't contain timezone information in datetime of cache.
This work on Python2 and Python3 with standard libraries only (but, trying to treat timezone in Python2 should third-party library like pytz).

@netmarkjp
Copy link
Contributor

@shiimaxx Thanks a lot ☺️

seek/y2Q55o5X_gupsGXqUEpn2VDgb9k=.cache is added but should we add this file?

@shiimaxx
Copy link
Author

shiimaxx commented Feb 3, 2020

@netmarkjp
Sorry, I pushed some local test files. Deleted those files and force pushed.

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.

2 participants