Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

Ability to set expiry for memcache values #45

Open
jakearchibald opened this issue Apr 23, 2015 · 2 comments
Open

Ability to set expiry for memcache values #45

jakearchibald opened this issue Apr 23, 2015 · 2 comments

Comments

@jakearchibald
Copy link

Seems like the python client can do this https://cloud.google.com/appengine/docs/python/memcache/clientclass#Client_set

@hbizira
Copy link

hbizira commented Jun 5, 2015

+1

@thomasbuchis
Copy link

+1,

reading the code, the lib api includes support to expiration, but the mapper not. I think that the only thing needed is in lib/index.js change to -->
/**

  • Return a memcache set request proto.
    *
  • @param {!string} key key of the item to set
  • @param {!string} value value of the item to set
  • @param {!number} expiration in seconds of the item to set
  • @return {apphosting.MemcacheSetRequest} a memcache set request proto
    */
    function makeMemcacheSetProto(key, value, expiration) {
    var memcacheSetRequest = new apphosting.MemcacheSetRequest();
    var item = new apphosting.MemcacheSetRequest.Item();
    item.setKey(key);
    item.setValue(value);
    if(expiration)
    item.setExpiresInSeconds(expiration)
    item.setSetPolicy(apphosting.MemcacheSetRequest.SetPolicy.SET);
    memcacheSetRequest.addItem(item);
    return memcacheSetRequest;
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants