Have you ever waited for a progress bar to complete just to see how it restarted from the beginning? This is a broken pattern. You should use a different type of loading indicator when you don't know how long a process will take.
Take this action
Don't use looping progress bars. Only use progress bars when you can estimate the time it takes to complete the process. If you don't know how long it will take, use a spinner animation instead.