First sync when laptop wakes from sleep always fails then delay before successful sync #3623
-
|
Everything is working as it should - this is an optimization or improvement question (or perhaps feature request): When my laptop wakes from sleep I immediately get a synchronization which fails out due to my WiFi card not being awake yet (so a network failure). I assume this sync takes place immediately because by clock time the last sync was a long time ago and the sync frequency has timed out. Question: Is there a way to make the first sync on my laptop waking from sleep be delayed? Discussion: I understand that OneDrive probably has no idea the laptop was sleeping, so my thought was to apply this delay whenever the standard sync time has not only elapsed, but elapsed by a lot (indicating the laptop was sleeping). This delay would then have no impact to normal operations and only take place when the laptop is not processing for a long time (like when it is sleeping or hibernating). My Setup: OneDrive is started by OneDriveGUI (I think?) - everything loads and starts at boot of my laptop. After first boot both OneDrive and OneDriveGUI remain running forever and I just sleep my computer when it is not in use and it wakes from sleep and everything resumes as you would expect. OneDrive onedrive v2.5.9-1+np1+1.1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
When the client runs, when coming out of a sleep state is something more of a customisation of your operating environment than a feature request and/or code fix here. The easiest element to implement is a systemd system-sleep hook. A What you will need to develop is a script, that restarts the systemd service that is enabled, so when you are sleeping your laptop or waking your laptop - when you wake/resume, you restart the applicable 'onedrive' service(s). This way on system resume, the service is restarted, clearing any stale curl status, but puts the client into probing the network in the correct manner waiting for this to be available and connected. The You need to create the folder You then need to create a script, make it executable, and put it in that location. For example: #!/bin/sh
# $1 = pre|post, $2 = suspend|hibernate|hybrid-sleep|suspend-then-hibernate
case "$1" in
post)
# If onedrive is a *system* service
#
# or change this to the actual service that has been created - and this is 100% unique based on the systemd services that OneDriveGUI creates
/usr/bin/systemctl restart onedrive.service
;;
esac
Use this as a starting point - augment as needed. |
Beta Was this translation helpful? Give feedback.
@DoneWorkin
When the client runs, when coming out of a sleep state is something more of a customisation of your operating environment than a feature request and/or code fix here.
The easiest element to implement is a systemd system-sleep hook.
A
systemd-suspend.serviceruns executables in/usr/lib/systemd/system-sleep/supporting 2 arguments for suspend, hibernate etc.What you will need to develop is a script, that restarts the systemd service that is enabled, so when you are sleeping your laptop or waking your laptop - when you wake/resume, you restart the applicable 'onedrive' service(s).
This way on system resume, the service is restarted, clearing any stale curl status, but puts the …