Class StartupTasks

java.lang.Object
org.localify.common.StartupTasks
All Implemented Interfaces:
org.springframework.boot.CommandLineRunner

@Component public class StartupTasks extends Object implements org.springframework.boot.CommandLineRunner
A component for running various startup and scheduled tasks.
  • Constructor Details

    • StartupTasks

      @Autowired public StartupTasks(BandsInTownDispatch bandsInTownDispatch, GoogleDispatch googleDispatch, PollstarDispatch pollstarDispatch, SpotifyDispatch spotifyDispatch, SpotifyApiDispatch spotifyApiDispatch, LocalifyProperties properties, CityRepository cityRepository, PlaylistService playlistService, VenueRepository venueRepository, UserCityRepository userCityRepository, RecommendService recommender, VenueService venueService, CityService cityService, org.springframework.mail.javamail.JavaMailSender mailSender, UserRepository userRepository, ArtistRepository artistRepository, SongRepository songRepository, FileIngest fileIngest, ScraperIngest scraperIngest, SpotifyService spotifyService, ArtistCityRepository artistCityRepository, WeeklyEmailRegistrationTokenRepository weeklyEmailRegistrationTokenRepository)
      Constructs a new StartupTasks.
      Parameters:
      bandsInTownDispatch - The BandsInTown dispatch service.
      googleDispatch - The Google dispatch service.
      pollstarDispatch - The Pollstar dispatch service.
      spotifyDispatch - The Spotify dispatch service.
      spotifyApiDispatch - The Spotify API dispatch service.
      properties - The application properties.
      cityRepository - The city repository.
      playlistService - The playlist service.
      venueRepository - The venue repository.
      userCityRepository - The user-city repository.
      recommender - The recommendation service.
      venueService - The venue service.
      cityService - The city service.
      mailSender - The mail sender.
      userRepository - The user repository.
      artistRepository - The artist repository.
      songRepository - The song repository.
      fileIngest - The file ingest service.
      scraperIngest - The scraper ingest service.
      spotifyService - The Spotify service.
      artistCityRepository - The artist-city repository.
      weeklyEmailRegistrationTokenRepository - The weekly email registration token repository.
  • Method Details

    • run

      public void run(String... args) throws Exception
      Specified by:
      run in interface org.springframework.boot.CommandLineRunner
      Throws:
      Exception
    • dispatchBitArtists

      @Scheduled(fixedRate=5L, timeUnit=MINUTES) public void dispatchBitArtists()
      Dispatches artists to be scraped from BandsInTown. 3 Cases for BIT by Artist: 1. Artist has never been queued before - Queue immediately 2. Artist has been queued but never found - Queue every 90 days 3. Artist has been found - Queue every week
    • dispatchBitUnknownArtists

      @Scheduled(fixedRate=5L, timeUnit=MINUTES) public void dispatchBitUnknownArtists()
      Dispatches unknown artists to be scraped from BandsInTown.
    • dispatchPollstarUnknownCities

      @Scheduled(fixedRate=5L, timeUnit=MINUTES) public void dispatchPollstarUnknownCities()
      Dispatches unknown cities to be scraped from Pollstar. 3 Cases for Pollstar by City: 1. City has never been queued before - Queue immediately 2. City has been queued but never found - Queue every 90 days 3. City has been found - Queue every week
    • dispatchPollstarCities

      @Scheduled(fixedRate=5L, timeUnit=MINUTES) public void dispatchPollstarCities()
      Dispatches known cities to be scraped from Pollstar.
    • dispatchPollstarArtists

      @Scheduled(fixedRate=5L, timeUnit=MINUTES) public void dispatchPollstarArtists()
      Dispatches known artists to be scraped from Pollstar. 3 Cases for Pollstar by Artist: 1. Artist has never been queued before - Queue immediately 2. Artist has been queued but never found - Queue every 90 days 3. Artist has been found - Queue every week
    • dispatchPollstarUnknownArtists

      @Scheduled(fixedRate=5L, timeUnit=MINUTES) public void dispatchPollstarUnknownArtists()
      Dispatches unknown artists to be scraped from Pollstar.
    • dispatchGoogleCities

      @Scheduled(fixedRate=30L, timeUnit=MINUTES) public void dispatchGoogleCities()
      Dispatches cities to be scraped from Google.
    • dispatchSpotifyArtists

      @Scheduled(fixedRate=30L, timeUnit=MINUTES) public void dispatchSpotifyArtists()
      Dispatches artists to be scraped from Spotify.
    • dispatchSpotifyApi

      @Scheduled(fixedRate=5L, timeUnit=MINUTES) public void dispatchSpotifyApi()
      Dispatches artists to be updated via the Spotify API.
    • bulkDispatchSpotifyApi

      @Scheduled(fixedRate=20L, timeUnit=HOURS) public void bulkDispatchSpotifyApi()
      Bulk dispatches all artists to be updated via the Spotify API.
    • bulkDispatchTrackAcousticsSpotifyApi

      @Scheduled(fixedRate=20L, timeUnit=MINUTES) public void bulkDispatchTrackAcousticsSpotifyApi()
      Bulk dispatches tracks to have their acoustic features updated via the Spotify API.
    • updateSpotifyPlaylists

      @Scheduled(cron="0 0 5 * * WED") public void updateSpotifyPlaylists()
      Updates all Spotify playlists.
    • emailDigest

      @Scheduled(cron="0 0 11 * * WED") public void emailDigest()
      Sends a weekly email digest to all subscribed users.
    • geocodeTimeZones

      @Scheduled(fixedRate=5L, timeUnit=MINUTES) public void geocodeTimeZones()
      Finds and sets the timezone for cities that do not have one.