package me.jimwayneyeh.aws.lambda.apiwarmer.resources;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ThreadResource {
  private static final Logger log = 
      LoggerFactory.getLogger(ThreadResource.class);
  private static ScheduledExecutorService pool = null;
  
  static {
    initiateThreadPool();
  }
  
  public static synchronized void initiateThreadPool () {
    int numberInPool = 5;
    String poolStr = System.getenv("threadpool");
    if (StringUtils.isNotBlank(poolStr) && StringUtils.isNumeric(poolStr)) {
      numberInPool = Integer.parseInt(poolStr);
    }
    
    log.info("Initiate execution pool with {} threads.", numberInPool);
    Executors.newScheduledThreadPool(numberInPool);
  }
  
  public static ScheduledExecutorService getPool () {
    return pool;
  }
}
@@ -839,16 +839,23 @@
 l);%0D%0A   
+ pool =
  Executo

Fix null pointer.