bernhard Posted February 10, 2022 Share Posted February 10, 2022 Hey @adrian I'm working on a new version of RockMigrations that triggers migrations automatically whenever a file changed. I'm using logs to echo some information about the migrations. Thats nice because when I change a file and reload the page I see that the migrations have run which is indicated by new logs which makes the tree icon orange. What I noticed today is that sometimes this tree stays orange for additional 1-2 reloads... First I thought I might have some bugs in my change detection but the timestamps of the logs say there's been no change (no new log) but the icon indicates something different. Does that make sense? How does the tree icon detect if it should be gray or orang? Thx! 1 Link to comment Share on other sites More sharing options...
adrian Posted February 10, 2022 Share Posted February 10, 2022 It's a bit hacky - it looks for an entry within the last 5 seconds and color orange if there is one. I figured this was probably OK for manual reloads. It turns the icon red if the last entry (within those 5 seconds) is an error. I'll take a look at improving this - should be quite easy now that I am caching the results in a wirCache because I'll be able to tell if there is a new entry or not. This wasn't really possible until I introduced the caching. Link to comment Share on other sites More sharing options...
bernhard Posted February 10, 2022 Author Share Posted February 10, 2022 Ok great! Yeah it felt like there was some kind of delay kicking in and that explains what I was observing. Thx a lot ? 1 Link to comment Share on other sites More sharing options...
adrian Posted February 10, 2022 Share Posted February 10, 2022 Ok, please give the latest version a go. It should be much better in that you now get notification of new entries no matter when they happen relative to when you reload the page - they might even happen in another process. Thanks for prompting me to revisit this. 1 Link to comment Share on other sites More sharing options...
bernhard Posted February 11, 2022 Author Share Posted February 11, 2022 hi @adrian thx for the quick update! Seems to work great now after some reloads! Initially I had little problems, but the seem to be gone now, I'll share them FYI: - updated tracy - changed file (to trigger migrations) - tree was red, not orange (why?) I thought maybe there's something left somewhere... - delete all logs - change file (to trigger migrations) - tree is gray, but new logs sow up Ok one more... - changed file (to trigger migrations) - tree is orange, logs show up Now everything works nicely! Link to comment Share on other sites More sharing options...
adrian Posted February 11, 2022 Share Posted February 11, 2022 Interesting that it didn't work straight away. If you find similar issues again, please let me know - maybe I've overlooked something? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now