Flow stops when device goes to sleep

Post your questions and help other users.

Moderator: Martin

Post Reply
ziotempa
Posts: 55
Joined: 30 Nov 2018 08:54

Flow stops when device goes to sleep

Post by ziotempa » 04 Aug 2019 22:04

Hi all
I run a flow which contains a loop which has to work for hours. Anyway my device goes to auto lock after 5 minutes. When this happens, the flow stops, so that when I unlock the phone I can see that the notification which shows the progress of the flow doesn't update any more and if I open the flow I cannot see any red brick. The flow has in fact stopped working
I can also tell you, as a side note, that I have a flow which is trigged every minute, that works good also when the display is off and the phone is locked
What am I doing wrong that this flow shuts down automatically?
Thank you
V

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: Flow stops when device goes to sleep

Post by Rafi4 » 04 Aug 2019 22:21

Hi ziotempa
I am in a bit confusion. Please post your flow.
From record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

ziotempa
Posts: 55
Joined: 30 Nov 2018 08:54

Re: Flow stops when device goes to sleep

Post by ziotempa » 05 Aug 2019 05:50

Ok, here it is
flow_Rinomina_files_20190805_074852.xml
(11.58 KiB) Downloaded 1181 times

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Flow stops when device goes to sleep

Post by Martin » 05 Aug 2019 14:35

Hi,

It sounds like this would not be caused by a battery optimization of your device. Anyway, please check this page to see if there are instructions to disable battery optimization to see if this helps: https://dontkillmyapp.com/
If this still happens, could you please turn on Debug log and Write log to file in the preferences of Automagic, reproduce the issue and then send the log to me (menu->Log, menu->Send Log)?

Regards,
Martin

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Flow stops when device goes to sleep

Post by Desmanto » 05 Aug 2019 16:09

Beside the battery optimization, why it tooks hours just to rename files? How many files do you rename at one execution? That enormous 10000 AES should not be as big as that.

I studied your flow and it seems you want to rename any non IMG_ and VID_ files to IMG_ appended files in certain folder. If that is the case, you can actually do that in only maybe 3 elements (my rough concept) : Init files, script and then execute command. You can rename all at once, don't have to be looped al the way long. Even if the rename take so long per file (because rename happen at external sdcard), it should be at least much faster than many script/expressions.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

ziotempa
Posts: 55
Joined: 30 Nov 2018 08:54

Re: Flow stops when device goes to sleep

Post by ziotempa » 05 Aug 2019 16:26

Hi both, thanks for the answers

First: I did the main part of this flow some time ago and I feel that I couldn't run a rename command because of permissions even though now I don't remember well
Second: it took 7 seconds for a single rename (move command) but after I think an hour or so my SD card became unreadable. I guess there was already some problem with that, now I'm spending lot of time transferring all the content to my pc to save photos, music and so on. On the laptop it is readable but it's still taking a lot of time to transfer most of the files. So I think that the main problem of the slowness was related to the SD card.

Post Reply