def _set_cached_solve(self, solver_dict):
if self.status_ != ResolverStatus.solved:<EOL><INDENT>return  <EOL><DEDENT>if not (self.caching and self.memcached_servers):<EOL><INDENT>return<EOL><DEDENT>releases_since_solve = False<EOL>release_times_dict = {}<EOL>variant_states_dict = {}<EOL>for variant in self.resolved_packages_:<EOL><INDENT>time_ = get_last_release_time(variant.name, self.package_paths)<EOL>if time_ == <NUM_LIT:0>:<EOL><INDENT>self._print("<STR_LIT>"<EOL>"<STR_LIT>",<EOL>variant.name)<EOL>return<EOL><DEDENT>if self.timestamp and self.timestamp < time_:<EOL><INDENT>releases_since_solve = True<EOL><DEDENT>release_times_dict[variant.name] = time_<EOL>repo = variant.resource._repository<EOL>variant_states_dict[variant.name] =repo.get_variant_state_handle(variant.resource)<EOL><DEDENT>timestamped = (self.timestamp and releases_since_solve)<EOL>key = self._memcache_key(timestamped=timestamped)<EOL>data = (solver_dict, release_times_dict, variant_states_dict)<EOL>with self._memcached_client() as client:<EOL><INDENT>client.set(key, data)<EOL><DEDENT>self._print("<STR_LIT>", key)<EOL>
Store a solve to memcached.

        If there is NOT a resolve timestamp:
            - store the solve to a non-timestamped entry.

        If there IS a resolve timestamp (let us call this T):
            - if NO newer package in the solve has been released since T,
              - then store the solve to a non-timestamped entry;
            - else:
              - store the solve to a timestamped entry.