Skip to content

Instantly share code, notes, and snippets.

/Users/avnerbarr/workspace/docker-dev/offline-scripts/GORMirror: ./.build/x86_64-apple-macosx/debug/GORMirror there are 1161 potential requests in file ✅ Request(httpVerb: GORMirror.Request.Verb.POST, endpoint: "/v2/recommend?_=1565526951847", requestBody: Optional(424 bytes), headers: nil)

❌ Request(httpVerb: GORMirror.Request.Verb.POST, endpoint: "/recommend?_=1565526947636", requestBody: Optional(503 bytes), headers: nil)

there are 1161 potential requests in file

❌ POST /recommend?_=1565526947122 BODY: {"sec":8771591,"uid":"-2769713442859793034","data":{"wId":"55571","fId":16583,"maxProducts":24,"rules":[{"id":217054,"type":"include","slots":[],"isContextAware":true}],"ctx":{"type":"PRODUCT","data":["2000352323022"]},"filtering":[]},"v":1} 1c1
endpoint status
import java.util.concurrent.locks.ReentrantReadWriteLock
import com.typesafe.scalalogging.LazyLogging
import scala.collection.mutable
import scala.concurrent.duration._
/**
* Trivial cache which is lazily limited to size - when size is exceeded with evict the oldest object
* @param limitSize the limit size option
// lock code around a file handle when multiple processes running and single access
fn main() {
std::thread::spawn(|| {
let lock = with_lock("my_lock".to_string());
loop {
let r = lock(|| {
sleep(Duration::from_millis(100));
"blah"
});
sleep(Duration::from_millis(500));