old_contents: """
  Event Tracking Module
  """
  from datetime import datetime
  
  import asyncio
  import json
  
  import aioredis
  
  from eventify.tracking.constants import EVENT_TRACKING_HOST
  
  
  loop = asyncio.get_event_loop()
  
  async def track_event(event, state, service_name):
      """
      Store state of events in memory
      :param event: Event object
      :param state: EventState object
      :param service_name: Name of service name
      """
      redis = await aioredis.create_redis(
          (EVENT_TRACKING_HOST, 6379), loop=loop)
  
      now = datetime.utcnow()
      event_id = event.event_id
  
      tracking_data = json.dumps({
          "event_id": event_id,
          "timestamp": str(now),
          "state": state
      })
      await redis.rpush(service_name, tracking_data)
      redis.close()
      await redis.wait_closed()
  
  
  async def get_last_event(service_name):
      """
      Get the last event on cache
      :param service_name: Name of service
      """
      pass
  
new_contents: """
  Event Tracking Module
  """
  from datetime import datetime
  
  import asyncio
  import json
  
  import aioredis
  
  from eventify.tracking.constants import EVENT_TRACKING_HOST
  
  
  loop = asyncio.get_event_loop()
  
  async def track_event(event, state, service_name):
      """
      Store state of events in memory
      :param event: Event object
      :param state: EventState object
      :param service_name: Name of service name
      """
      redis = await aioredis.create_redis(
          (EVENT_TRACKING_HOST, 6379), loop=loop)
  
      now = datetime.utcnow()
      event_id = event.event_id
  
      tracking_data = json.dumps({
          "event_id": event_id,
          "timestamp": str(now),
          "state": state
      })
      await redis.rpush(service_name, tracking_data)
      redis.close()
      await redis.wait_closed()
  
subject: remove useless function