axengine

Results 5 comments of axengine

gin可能使用了内存池或者sync.Pool等技术来管理内存,可能对[]byte的复用,而InMemoryStore直接缓存了gin的[]byte,因此可能被覆盖。重写cache的Write方法可以解决该问题。 ``` func (w *cachedWriter) Write(data []byte) (int, error) { ret, err := w.ResponseWriter.Write(data) if err == nil { store := w.store var cache responseCache if err := store.Get(w.key, &cache);...

@zxmrlc 对缓存数据要先分配内存,做一次强拷贝,你的代码还是直接缓存了上层传过来的[]byte。 使用CachePageAtomic替换CachePage方法,CachePage在并发时会引起缓存数据错误。

@zxmrlc 我fork了cache项目,修复了这个问题,你可以直接 `https://github.com/axengine/cache`

> ``` > // start ------- > if err := store.Get(w.key, &cache); err == nil { > // why it needs a append operation? > data = append(cache.Data, data...) >...

modify scripts/extension.py:165 `sys.path.append(paths.script_path+'/extensions/SadTalker') `