Skip to content

Instantly share code, notes, and snippets.

@dustydecapod
Created February 6, 2019 21:20
Show Gist options
  • Save dustydecapod/c6e5cfbc0647dbece564fa18a6de6797 to your computer and use it in GitHub Desktop.
Save dustydecapod/c6e5cfbc0647dbece564fa18a6de6797 to your computer and use it in GitHub Desktop.
import cacheops, sys
from django import setup
setup()
from redis import Redis
from apps.feature_flags.backends.smart_redis import SmartRedisDict
from django.conf import settings
storage = Redis(**settings.FEATURE_FLAG_DB['connection'])
redis_dict = SmartRedisDict('gutter', storage)
encoded = {x:redis_dict.encoding.encode(y) for x,y in redis_dict.items()}
import json
f = open("/root/%s.dump" % sys.argv[1], 'w')
json.dump(encoded, f)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment