You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@radex We have the issue where we need to run a service in the background asynchronously.
One of the use cases is basically that the user can take many actions offline then when they come back online we pull all those records from watermelon send them to an API and then delete them locally when we get a successful response. If we have 200 actions then we just have to wait on any given screen where we call this background service to loop through all of them.
We want it to upload in the background while they continue to use the app. As mentioned part of this service is to delete something after an API call is made. If we leave it running with no await on the writer, then we get enqueued writers if we perform other writing actions while this method is running in the background, or even on itself if its trying to delete multiple at the same time. We always have control and will never write to a record we are currently altering so we want to be able to avoid the error an enqueued writer throws. In this case it just won't delete the record if it gets stuck.
Is there anyway undocumented way to delete the record without using the writer?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
@radex We have the issue where we need to run a service in the background asynchronously.
One of the use cases is basically that the user can take many actions offline then when they come back online we pull all those records from watermelon send them to an API and then delete them locally when we get a successful response. If we have 200 actions then we just have to wait on any given screen where we call this background service to loop through all of them.
We want it to upload in the background while they continue to use the app. As mentioned part of this service is to delete something after an API call is made. If we leave it running with no await on the writer, then we get enqueued writers if we perform other writing actions while this method is running in the background, or even on itself if its trying to delete multiple at the same time. We always have control and will never write to a record we are currently altering so we want to be able to avoid the error an enqueued writer throws. In this case it just won't delete the record if it gets stuck.
Is there anyway undocumented way to delete the record without using the writer?
Beta Was this translation helpful? Give feedback.
All reactions