Would you continue writing your work-in-progress if someone with a crystal ball said that it would never be published?
I was asked if I would continue to write my books just for the pleasure of writing, or whether I would give up on my stories if they never got published.
I don't like leaving something unfinished. So, I do think I would have to finish my story, and try to get it published. If I wasn't successful, I would try again, but with another story.
Each story I write my craft improves, so that motivates me. But, I think timing and luck are definitely a part of success, and those things are out of my hands.