P2 checks repository once [message #1744234] |
Fri, 23 September 2016 13:47 |
Jean-Pascal Laux Messages: 81 Registered: December 2011 |
Member |
|
|
Hello,
I have an application that :
- Do check for updates at startup and display a message if updates are available
- Has a menu handler that check for updates and if updates are available, install them
- a timer job that check the repository every hour
1)
at startup, if updates are available, the message is displayed. When the user selects the menu handler, a check and an update hare done
2)
at startup, if no updates are available,no message is displayed. When the user selects the menu handler, a check should be done but that does not work. With a sniffer, I can see the first connection (startup) to the repository. After the fist check with no update, no new connection to the repository has been done.
I have checked many things but found nothing.
Jean-Pascal
|
|
|
|
Re: P2 checks repository once [message #1744353 is a reply to message #1744267] |
Mon, 26 September 2016 09:24 |
ALex W Messages: 56 Registered: July 2012 |
Member |
|
|
P2 uses some caching mechanisms.
I solved this in my app by forcing a refresh in the update sequence. Not sure it's the right way to do it, but it seems to do the job.
Simplified version of the code
URI[] lstMetadataRepositories = metadataManager.getKnownRepositories(IMetadataRepositoryManager.REPOSITORIES_ALL);
URI[] lstArtifactRepositories = artifactManager.getKnownRepositories(IMetadataRepositoryManager.REPOSITORIES_ALL);
for (URI uri : lstMetadataRepositories) {
metadataManager.refreshRepository(uri, monitor);
}
for (URI uri : lstArtifactRepositories) {
artifactManager.refreshRepository(uri, monitor);
}
}
Complete code : https://github.com/cncgoko/Goko/blob/dev/Goko/src/goko/GokoUpdateCheckRunnable.java
[Updated on: Mon, 26 September 2016 09:26] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04609 seconds