The nation with the energy resources can continue as long as they want. The only way I see it ending is if Russia has to pull their forces out to try to hold off a future attempt by China to take Siberia.
Russia may have energy but they lack the industrial base to replace all the weaponry they’re losing and using. Their citizenry is also starting to suffer from the war in the form of 200,000 people unemployed in Moscow alone, unable to receive remittances from their relatives in other countries, and consumer goods are absent from Russia as indicated by the items Russian troops are looting from Ukraine.