Alexander Maclaren said this quote

Self-preservation is not a man’s first duty: flight is his last. Better and wiser and infinitely nobler to stand a mark for the slings and arrows of outrageous fortune and to stop at our post though we fall there, better infinitely to toil on, even when toil seems vain, than cowardly to keep a whole skin at the cost of a wounded conscience or despairingly to fling up work, because the ground is hard and the growth of the seed imperceptible. Prudent advices, when the prudence is only inspired by sense, are generally foolish.