Not to worry - Cody didn't get shot. Luckily, because in battle this happened very, very often. Maybe even on a daily basis. But this shot is different.
Flashback: After Palpatine's downfall, the kaminoans were captured by the republic and were used to do research and experiments to increase the life expectancy of the clones, especially ARC Trooper Fives stood up for the Clone rights.
After many months the kaminoans developed a substance, which, if injected once a year, can decrease the fast aging of the clones and this can give them up to 40 years + lifespan (because the clones' physical age is like 20-35 years old at the moment, this means 10-15 years of actual age)
Cody and Obi had a long and deep conversation on this theme. But as Cody wished, he got his first shot of the "lifesaver".
As this affects nearly every Part of the body, Cody is very exhausted after the injection. He has to stay in Hospital for a few days, and Obi-Wan visits him every day. For hours he waits for Cody to wake up and he gently holds his hand. He is excited, if the lifesaver works, but deep down He already knows: Cody and he will now have much more time.