public static synchronized ScheduledExecutorService scheduler() { if (SCHEDULER == null) { int threads = Conf.option("threads", 100); SCHEDULER = Executors.newScheduledThreadPool(threads / 2, new RapidoidThreadFactory("jobs")); } return SCHEDULER; }
public static synchronized Executor executor() { if (EXECUTOR == null) { int threads = Conf.option("threads", 100); EXECUTOR = Executors.newFixedThreadPool(threads); } return EXECUTOR; }
@Test public void testSecret() { notNull(Crypto.secret()); isTrue(Crypto.secret() == Crypto.secret()); // default secret in dev mode is an empty string eq(Crypto.secret(), ""); Conf.args("secret=mysecret"); eq(Crypto.secret(), "mysecret"); }