Modify

Opened 4 years ago

Last modified 4 years ago

#19549 new enhancement

[RFC Patch] Don't store cached file information in preferences

Reported by: taylor.smock Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description (last modified by taylor.smock)

Since, as far as I know, JOSM Preferences never clears out old entries, it would be nice to avoid adding unnecessary entries.

The attached patch does the following:

  • Uses file metadata to get the age of the file
  • Adds an option to have files deleted on graceful exit (does not delete files if the exit is forced).

This is an RFC since (AFAIK) there are not commonly used file systems which do not store the modification time.

Attachments (2)

19549.patch (9.7 KB ) - added by taylor.smock 4 years ago.
Initial RFC patch
19549.preferences_cleanup.patch (2.4 KB ) - added by taylor.smock 4 years ago.
Add a cleanup function to preferences

Download all attachments as: .zip

Change History (8)

by taylor.smock, 4 years ago

Attachment: 19549.patch added

Initial RFC patch

comment:1 by taylor.smock, 4 years ago

Description: modified (diff)

comment:2 by GerdP, 4 years ago

can you explain what "unnecessary entries" you mean?

comment:3 by GerdP, 4 years ago

Ah, probably entries like this:

  <list key='mirror.C:\Users\Gerd\AppData\Local\JOSM\cache\images.https://raw.githubusercontent.com/OpenNauticalChart/josm/master/icons/svg/Q/Q126/CEVNI/berthing_lateral_limit.svg'>
    <entry value='1548567266688'/>
    <entry value='C:\Users\Gerd\AppData\Local\JOSM\cache\images\mirror_https___raw.githubusercontent.com_OpenNauticalChart_josm_master_icons_svg_Q_Q126_CEVNI_berthing_lateral_limit.svg'/>
  </list>

comment:4 by taylor.smock, 4 years ago

I originally copied the CachedFile source into the OpenQA plugin (since I usd it to get data from various QA APIs -- I didn't want to accidentally overload someone's server). I made some modifications there so that I wouldn't make JOSM Preferences explode in size.

But yes, that would probably be another entry that would be unnecessary.

comment:5 by stoecker, 4 years ago

Hmm, I'm not enthusiastic about the proposal. Why not simply add a cleanup function in Prefs loader which clean unnecessary stuff from time to time (i.e. with version upgrades)?

by taylor.smock, 4 years ago

Add a cleanup function to preferences

in reply to:  5 comment:6 by taylor.smock, 4 years ago

Replying to stoecker:

Hmm, I'm not enthusiastic about the proposal. Why not simply add a cleanup function in Prefs loader which clean unnecessary stuff from time to time (i.e. with version upgrades)?

I've added a cleanup function (it isn't perfect, and it definitely needs more work, but I think it is the direction you were talking about).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to taylor.smock.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.