Modify

Opened 15 months ago

Last modified 14 months 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 15 months ago.
Initial RFC patch
19549.preferences_cleanup.patch (2.4 KB) - added by taylor.smock 14 months ago.
Add a cleanup function to preferences

Download all attachments as: .zip

Change History (8)

Changed 15 months ago by taylor.smock

Attachment: 19549.patch added

Initial RFC patch

comment:1 Changed 15 months ago by taylor.smock

Description: modified (diff)

comment:2 Changed 15 months ago by GerdP

can you explain what "unnecessary entries" you mean?

comment:3 Changed 15 months ago by GerdP

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 Changed 15 months ago by taylor.smock

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 Changed 15 months ago by 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)?

Changed 14 months ago by taylor.smock

Add a cleanup function to preferences

comment:6 in reply to:  5 Changed 14 months ago by taylor.smock

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.
to The owner will be changed from team to the specified user.
The owner will change to taylor.smock
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.