def _get_request_args(args):
    """
        Build a tuple of the maximum age an event can be plus the maximum amount
        of records to return in the SQL query.

        If no argument is provided, or the value is uncastable to an int the
        respective default value or 360 and 1000 will be returned.
    """
    try:
        maxage = int(args.get('maxage', 360))
    except ValueError:
        maxage = 360

    try:
        maxcount = int(args.get('maxcount', 1000))
    except ValueError:
        maxcount = 1000

    return maxage, maxcount