public TorrentsSeeder()

in common/src/main/java/jetbrains/buildServer/torrent/seeder/TorrentsSeeder.java [58:87]


  public TorrentsSeeder(@NotNull File torrentStorage,
                        int maxTorrentsToSeed,
                        @Nullable PathConverter pathConverter,
                        ScheduledExecutorService executor,
                        @NotNull final TorrentConfiguration torrentConfiguration,
                        @NotNull final TrackerClientFactory trackerClientFactory) {
    myMaxTorrentsToSeed = maxTorrentsToSeed;
    myTorrentFilesDB = new TorrentFilesDB(new File(torrentStorage, "torrents.db"), maxTorrentsToSeed, pathConverter, new TorrentFilesDB.CacheListener() {
      public void onRemove(@NotNull Map.Entry<File, File> removedEntry) {
        myClient.stopSeeding(removedEntry.getValue());
        if (myRemoveExpiredTorrentFiles) {
          FileUtil.delete(removedEntry.getValue());
        }
      }
    });
    int workerPoolSize = torrentConfiguration.getWorkerPoolSize();
    myWorkerExecutor = new TeamCityThreadPoolExecutor(workerPoolSize, workerPoolSize,
            60L, TimeUnit.SECONDS,
            new LinkedBlockingQueue<Runnable>(2000),
            new NamedThreadFactory(PLUGIN_EXECUTOR_NAME));
    myWorkerExecutor.allowCoreThreadTimeOut(true);
    int pieceHashingPoolSize = torrentConfiguration.getPieceHashingPoolSize();
    myValidatorExecutor = new TeamCityThreadPoolExecutor(pieceHashingPoolSize, pieceHashingPoolSize,
            60L, TimeUnit.SECONDS,
            new LinkedBlockingQueue<Runnable>(2000),
            new NamedThreadFactory(PIECE_VALIDATOR_EXECUTOR_NAME));
    myValidatorExecutor.allowCoreThreadTimeOut(true);
    myClient = new TeamcityTorrentClient(myWorkerExecutor, myValidatorExecutor, trackerClientFactory);
    myExecutor = executor;
  }