URGENT : Need help to clear the cache
  • Hey guys,

    I'm using the trick of scheduling the newestfile.mp3 and replacing the content of that file every week but I have a problem.

    The cache is playing the older version of the file and I can't find where and how I can stop airtime from caching completely.

    Is this possible to turn off caching completely, or is it possible to make it only cache say 10 minutes in advance?
  • 15 Comments sorted by
  • I've found this in /etc/airtime/airtime.conf

    cache_ahead_hours = 1

    Can I turn that off like this?

    cache_ahead_hours = 0
  • Tried that, doesn't work...

    Deleted the cached mp3 files in /var/temp/airtime/pypo/cache/scheduler

    Changed /etc/airtime/airtime.conf to : cache_ahead_hours = 0

    Rebooted the server

    Looked inside /var/temp/airtime/pypo/cache/scheduler and the files are back.

    Can somebody help please?
  • How are you getting the mp3 in?
    The trick only works if you ftp it in to a watched folder - overwriting the same filename.
    No longer using Airtime or Libretime.
  • Had/have exactly the same problem
    Schelstraete Bart - http://www.contact-dance.com
  • I have been running this 'trick' since 2.42 and never had a problem with the cache.
    It is important that you do NOT use the ordinary library import to do this trick. Use FTP or sFTP.

    No longer using Airtime or Libretime.
  • No John I don't get my mp3's in via FTP or sFTP.

    They are all being downloaded and moved into a watched folder via cron jobs.

    Why does this make a difference though? What's difference, as far as airtime is concerned, doing it your way or mine?
  • Also, why on Earth does airtime need to cache files so far in advance anyway? Surely it could just grab them say 10 minutes before they are due to play? I read somewhere that it caches them 24hrs before they are due to play? That is just insane...
  • Look in:   /etc/airtime/airtime.conf

    api_key = L6H6WFJ1SUEGC216U45Z
    web_server_user = www-data
    airtime_dir = /usr/share/airtime
    base_url = localhost
    base_port = 80
    base_dir = /
    cache_ahead_hours = 1

    No longer using Airtime or Libretime.
  • Yeah look above John, I've already tried that. Makes no difference.
  • I actually sent a support email this morning and got this back...

    "Thanks for using Airtime. Check out our forum for more answers on self-installs.

    Here's a quick search for what you are looking for: https://www.google.com/search?sitesearch=forum.sourcefabric.org&q=Cache+airtime"

    Very helpful... :(
  • Vote Up0Vote Down Josh McLainJosh McLain
    Posts: 44Member, Administrator, Sourcefabric Team
    Hi Ade,

    I'm Josh, I run our support team at Sourcefabric. Generally for self-hosted users we point them towards the forum for help for a couple reasons. The first is that since the majority of my time with Airtime is spent with Airtime Pro users, I don't have much experience tweaking hosted installations and we won't be much help, people like John are going to have creative ways to solve problems like this that you run into that I won't have thought of. The vast majority of the questions we have submitted about self hosted Airtime we want solved in the forum, for the exact reason that the next time someone asks a search will turn up the results they're looking for. 

    Ade Hill said:

     read somewhere that it caches them 24hrs before they are due to play? 

    It doesn't cache them that far in advance, it caches them an hour before they're scheduled to play. I think I saw the thread you were looking at and it said that Pypo deletes files in the cache that are 24 hours old.

    As for the original question, I'll ping the devs really quick when they get in later today and see if they know the answer off the top of their heads. 

  • Hi Josh,

    Thanks for your reply and I do understand that most of your resources are spent on Pro users.

    Re : the 24hr cache thing, this is where I read it - https://forum.sourcefabric.org/discussion/13980/airtime-2-0-3-cache-folder-grows-and-grows-and-old-cache-files-are-not-automatically-cleared/p1

    Thanks, would really appreciate that if you could.


  • Vote Up0Vote Down Josh McLainJosh McLain
    Posts: 44Member, Administrator, Sourcefabric Team
    Ade Hill said:

    Right, I think they're added to the cache an hour before they're played and cleaned out 24 hours later.
  • Vote Up0Vote Down Josh McLainJosh McLain
    Posts: 44Member, Administrator, Sourcefabric Team
    Try this:

    In the file /usr/lib/airtime/pypo/pypofetch.py there is a function called cache_cleanup. You can add/change the code in that function to clear the entire cache_dir directory
  • Hi Josh,

    Thanks I've had a look at that but I wouldn't even know where to start adding a "clear cache every 15 mins" function. That's well beyond my capabilities i'm afraid. If it had already been in there and just needed tweaking I could have had a pop but it looks like i'd need to write it from scratch. I can't see anywhere that's defining a time at all?