You can set your MacBook Air or Pro to keep on receiving app updates in sleep mode, such as iMessage or iCloud, when on battery power.
Keep Your MacBook Up to Date All the Time by Enabling Background App Updates While in Sleep on Battery Power
In order to save battery life while in sleep, your MacBook Air and MacBook Pro will not receive network traffic at all. This means no iMessage or iCloud updates, and everything resumes when you wake your notebook up.
However, if you’re plugged into a power outlet, every bit of data comes through while your Mac is asleep, ensuring everything is up to date when you wake up your notebook.
Thankfully, there’s a way to right this wrong and I’ll show you what you have to do.
Step 1. Launch System Settings on your MacBook.
Step 2. Click on Battery on the left.
Step 3. Scroll all the way down in the Battery section and then click on Options.
Step 4. Set ‘Wake for network access’ to Always. That’s all.

Whenever you close that display lid, your Mac will automatically access the network in the background to keep your apps and iCloud stuff up to date.
While this feature is great, do keep in mind that it may take a toll on your battery life, especially if you have too many updates coming in.
This feature will only work if there’s a known Wi-Fi network nearby, or you’re connected to Ethernet.