[Kde-pim] Review Request 115817: when connection to server fails, set it offline and retry later

Martin Koller kollix at aon.at
Sun Mar 16 12:38:18 GMT 2014



> On March 16, 2014, 10:49 a.m., Kevin Krammer wrote:
> > resources/dav/resource/davgroupwareresource.cpp, line 744
> > <https://git.reviewboard.kde.org/r/115817/diff/2/?file=254289#file254289line744>
> >
> >     Generally looks good, just pondering some ideas:
> >     
> >     maybe put that in a small helper method, something like
> >     
> >     retryAfterFailure(const QString &errorMessage)
> >     
> >     that does the emit, the deferTask and the setTemporaryOffline. That way we can easily change the timeout values in a single place, e.g. if we make the default configurable, etc.
> >     
> >     Another option would be to have this as a protected method in AgentBase, i.e. basically replacing the cancelTask() call, something like
> >     
> >     repeatFailedTask( const QString &errorMessage, int retryTimeoutInSeconds );
> 
> Martin Koller wrote:
>     I was looking into this idea of repeatFailedTask(). It would need to be implemented in ResourceBase as AgentBase does not know deferTask().
>     Still, I think such a method would be unclear as it does not simply "repeat" a failed task after some time but it sets the whole agent temporarily
>     to offline. so maybe it's just the name which is unclear.
>     What about setTemporaryOffline(const QString &errorMessage, int retryTimeoutInSeconds); as in AgentBase ?
> 
> Kevin Krammer wrote:
>     Ah, yes, didn't consider that defer was only avaiable in resources.
>     should be fine then

"Should be fine" means: "don't implement such a method at all" or implement "setTemporaryOffline(const QString &errorMessage, int retryTimeoutInSeconds);" in ResourceBase ?


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115817/#review53033
-----------------------------------------------------------


On March 16, 2014, 11:55 a.m., Martin Koller wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115817/
> -----------------------------------------------------------
> 
> (Updated March 16, 2014, 11:55 a.m.)
> 
> 
> Review request for KDEPIM, Dan Vrátil and Kevin Krammer.
> 
> 
> Repository: kdepim-runtime
> 
> 
> Description
> -------
> 
> The DAV resource would discard item modifications (add, change, remove) whenever it does not currently reach the DAV server,
> which can happen when I'm connected to the company network but have a DAV server in my home network only.
> 
> This patch makes sure to set the resource to temporary offline in these cases and retries to go online at configured check interval.
> 
> 
> Diffs
> -----
> 
>   resources/dav/resource/davgroupwareresource.h a514c94 
>   resources/dav/resource/davgroupwareresource.cpp b8b2f74 
> 
> Diff: https://git.reviewboard.kde.org/r/115817/diff/
> 
> 
> Testing
> -------
> 
> Tested against my owncloud-6 server
> 
> 
> Thanks,
> 
> Martin Koller
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list