Helper function for restoring session data from HashDB
(key, unserialize=False, checkConf=False)
| 5065 | conf.hashDB.write(_, value, serialize) |
| 5066 | |
| 5067 | def hashDBRetrieve(key, unserialize=False, checkConf=False): |
| 5068 | """ |
| 5069 | Helper function for restoring session data from HashDB |
| 5070 | """ |
| 5071 | |
| 5072 | retVal = None |
| 5073 | |
| 5074 | if conf.hashDB: |
| 5075 | _ = '|'.join((str(_) if not isinstance(_, six.string_types) else _) for _ in (conf.hostname, conf.path.strip('/') if conf.path is not None else conf.port, key, HASHDB_MILESTONE_VALUE)) |
| 5076 | retVal = conf.hashDB.retrieve(_, unserialize) if kb.resumeValues and not (checkConf and any((conf.flushSession, conf.freshQueries))) else None |
| 5077 | |
| 5078 | if not kb.inferenceMode and not kb.fileReadMode and isinstance(retVal, six.string_types) and any(_ in retVal for _ in (PARTIAL_VALUE_MARKER, PARTIAL_HEX_VALUE_MARKER)): |
| 5079 | retVal = None |
| 5080 | |
| 5081 | return retVal |
| 5082 | |
| 5083 | def resetCookieJar(cookieJar): |
| 5084 | """ |
no test coverage detected
searching dependent graphs…