Clearing the packages cache

When a new repo is imported, the packages cache needs to be deleted. The cache is on the front-end, the web server. Cache clearing on the web server is handled by the fp-listen daemon.

It does this by using the LISTEN command.

The list of channels it listens to is controlled by the listen_for table:

freshports.test=# \d listen_for
                               Table "public.listen_for"
   Column    |  Type   | Collation | Nullable |                Default                 
 id          | integer |           | not null | nextval('listen_for_id_seq'::regclass)
 name        | text    |           | not null | 
 script_name | text    |           | not null | 
    "listen_for_pkey" PRIMARY KEY, btree (id)
    "listen_for_name_idx" UNIQUE, btree (name)


The values now in place are:

freshports.test=# SELECT name, script_name FROM listen_for ORDER BY name;
      name      |      script_name      
 category_new   | listen_category_new
 date_updated   | listen_date_updated
 port_updated   | listen_port
 ports_moved    | listen_ports_moved
 ports_updating | listen_ports_updating
 vuxml          | listen_vuxml
(6 rows)


I’m planning to add a new one: packages_cache_clear INSERT INTO listen_for (name, script_name) values ('packages_cache_clear', 'ClearPackagesCache');

EDIT 2020-05-01 : This was implemented using zfs rollback for cache clearing.

Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top