def pot_job(hash_file=None, session=None, hash_mode=None,
            attack_mode=None, rules=None,
            pot_path=None, username=False):
    """
    Method to  queue job to run hashcat with the system potfile wordlist
    i.e. when potfile++ is enabled

    Arguments
    ---------
    crack: object
        Hashcat execution python object for rq to execute
    hash_file: string
        File containing hashes to feed to hashcat
    session: Hashcat session to use
    wordlist: Wordlist to feed Hashcat

    Returns
    -------
    """
    # check potfile wordlist is up-to-date
    pot_wordlist = valid.val_filepath(path_string=log_dir,
                                      file_string='pot_wordlist.txt')
    if not pot_check(pot_wordlist):
        potter(pot_path, pot_wordlist)
    outfile = valid.val_filepath(path_string=log_dir,
                                 file_string='{}.cracked'.format(session))
    # run hashcat with potfile wordlist
    hcat = runner(hash_file=hash_file,
                  session=session, wordlist=str(pot_wordlist),
                  outfile=str(outfile), attack_mode=0,
                  hash_mode=hash_mode,
                  username=username, pot_path=pot_path,
                  show=False, brain=False)
    hcat.event_connect(callback=finished_callback,
                       signal="EVENT_CRACKER_FINISHED")
    hcat.event_connect(callback=any_callback,
                       signal="ANY")
    counter = 0
    while counter < 600:
        if hcat is None or isinstance(hcat, str):
            return hcat
        hc_state = hcat.status_get_status_string()
        logger.debug('POT WORDLIST loop')
        if hc_state == 'Exhausted':
            break
        elif hc_state == 'Aborted':
            event_log = hcat.hashcat_status_get_log()
            raise ValueError(event_log)
        time.sleep(1)
        counter += 1
    else:
        return False
    logger.debug('POT WORDLIST loop complete, quitting hashcat')
    hcat.hashcat_session_quit()
    hcat.reset()
    return True

    Method to  queue job to run hashcat with the system potfile wordlist
    i.e. when potfile++ is enabled

    Arguments
    ---------
    crack: object
        Hashcat execution python object for rq to execute
    hash_file: string
        File containing hashes to feed to hashcat
    session: Hashcat session to use
    wordlist: Wordlist to feed Hashcat

    Returns
    -------
    
crackq/run_hashcat.py