afterUpdate life cycle

Hey Folks…

I am facing problem after update life cycle.
my problem is i want to update amount which is based on food. for example if someone want to purchase a burger which price is $50 and than he change his mind and want to purchase pizza which price is $20 and then he just remove burger and add pizza , and system calculate their amount according to quantity and price. for achieving this i wrote this life cycle

        `afterUpdate: async (data) => {
          let items = await strapi.query("items").find();
          let amount = 0;
          for (let i = 0; i < data.items.length; i++) {
            amount += items[i].quantity * items[i].food.price;
          }   
            strapi.query("orders").update(
              { id: data.id },
              {Total_Amount: amount,
                restaurant: data.items[0].restaurant,} );  },`

i used after update because if i used before update my data is not updated and burger is show is list but if i used after update pizza is showing instead of burger and system compute their price perfectly but problem is i used after update and in after update i used update so its going on infinite loop first the call update than he comes on after update life cycle and then it comes to update function which is written in my code and again they call after update that why they goes on infinite loop.So Please help me to resolve this problem