Set the requested intervals (to the database)

        :param intervals: The intervals
        :type intervals: TimeIntervals
        :return: None

def requested_intervals(self, intervals):
        """
        Set the requested intervals (to the database)

        :param intervals: The intervals
        :type intervals: TimeIntervals
        :return: None
        """
        with switch_db(WorkflowStatusModel, db_alias='hyperstream'):
            workflow_statuses = WorkflowStatusModel.objects(workflow_id=self.workflow_id)
            if len(workflow_statuses) != 1:
                workflow_status = WorkflowStatusModel(
                    workflow_id=self.workflow_id,
                    requested_intervals=[]
                )

            else:
                workflow_status = workflow_statuses[0]

            workflow_status.last_updated = utcnow()
            workflow_status.last_accessed = utcnow()
            workflow_status.requested_intervals = tuple(
                map(lambda x: TimeIntervalModel(start=x.start, end=x.end), intervals))

            workflow_status.save()