[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [GSoC] Prospective packages importer



Hi Akshita,

On Tue, Aug 25, 2015 at 12:33:46AM +0530, Akshita Jha wrote:
> > > Checking might not harm to create a proper error message since it can
> > > happen again in the future.
> > >
> >
> I have sent a patch which checks for "IntegrityError" while inserting
> packages in table blends_prospectivepackages. Can you please test and
> confirm ?
> 
> Also, nothing is inserted in the table blends_prospectivepackages if this
> error is raised. I am not sure if this is the best thing to do.

Yes, that's the problem.  While I check the error log of the importers
from time to time I'm afraid that UDD would remain static (=not up to
date) for a certain amount of time if this exception would be catched.
My strategy was to avoid such IntegrityErrors in the first place by
checking the status of the database (or against a package list I
maintain inside the importer script depending what sounds more
sensible).

> Another
> option could be to ignore the duplicated package (implying the package
> which comes second) and keep inserting other packages in the table. But,
> the problem here can be that the first package we get (the package which is
> inserted), is older than the one that is ignored. What do you think is a
> better implementation ?

The latter is better since it only affects one package and not the whole
set of packages in the queue.  We could even try to find out which
instance of the duplicate is the newer one since we usually have a
version number attached.  I'd take the later version number and throw a
warning into the importer log.

Kind regards

       Andreas.

-- 
http://fam-tille.de


Reply to: