浏览代码

flush mitm passthru cache when changing showBlockStats

pull/43/head
Jonathan Cobb 4 年前
父节点
当前提交
b438b3a5de
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. +5
    -0
      bubble-server/src/main/java/bubble/service/cloud/StandardDeviceIdService.java

+ 5
- 0
bubble-server/src/main/java/bubble/service/cloud/StandardDeviceIdService.java 查看文件

@@ -56,6 +56,10 @@ public class StandardDeviceIdService implements DeviceIdService {
// used in dnscrypt-proxy to determine how to respond to blocked requests
public static final String REDIS_KEY_DEVICE_REJECT_WITH = "bubble_device_reject_with_";

// used in mitmproxy to optimize passthru requests
// we flush keys with this prefix when changing showBlockStats flag
public static final String REDIS_KEY_CHUNK_FILTER_PASS = "__chunk_filter_pass__";

@Autowired private DeviceDAO deviceDAO;
@Autowired private AccountDAO accountDAO;
@Autowired private RedisService redis;
@@ -154,6 +158,7 @@ public class StandardDeviceIdService implements DeviceIdService {

public void initBlockStats (Account account) {
redis.set_plaintext(REDIS_KEY_ACCOUNT_SHOW_BLOCK_STATS+account.getUuid(), Boolean.toString(account.showBlockStats()));
redis.del_withPrefix(REDIS_KEY_CHUNK_FILTER_PASS);
for (Device device : deviceDAO.findByAccount(account.getUuid())) {
if (account.showBlockStats()) {
showBlockStats(device);


正在加载...
取消
保存